I wonder if anyone knows how to select a rectangle range of values? This range will not be fixed. For this particular example, it will select B5 – G7 in a rectangle form and then it will set a condition format to add in some colors.
I have attempted the codebut it is giving me an error at this portion
ActiveSheet.Cells(colorrow & "2", _
ActiveSheet.Cells(colorrow & "2").End(xlDown).End(xlToRight)).Select
wonder if anyone know why? will be thankful!

I have attempted writing out some coding.
My code is as follows:
Sub Macro2()
Dim thevaluestocopy As Variant, colorCell as Range, colorrow as Long, thefirstcolorrow as Long
colorrow = 1
Do
Set colorCell = Sheets("Sheet1").Cells(colorrow, 1)
'check for test1-test6 if its around do nothing, else goes to the next row and next column
If colorCell = "test1" Or colorCell = "test2" Or colorCell = "test3" _
Or colorCell = "test4" Or colorCell = "test5" Or colorCell = "test6" _ Then
'Do nothing
Else
thefirstcolorrow = Sheets("Sheet1").Cells(colorrow, 2)
'This statement gives me the error.. not sure why it cant work
ActiveSheet.Cells(colorrow & "2", _
ActiveSheet.Cells(colorrow & "2").End(xlDown).End(xlToRight)).Select
Exit Do
End If
colorrow = colorrow + 1
Loop
'add colors into cell
ActiveCell.Select
Selection.FormatConditions.AddColorScale ColorScaleType:=3
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
Selection.FormatConditions(1).ColorScaleCriteria(1).Type = _
xlConditionValueLowestValue
With Selection.FormatConditions(1).ColorScaleCriteria(1).FormatColor
.Color = 8109667
End With
Selection.FormatConditions(1).ColorScaleCriteria(2).Type = _
xlConditionValuePercentile
Selection.FormatConditions(1).ColorScaleCriteria(2).Value = 50
With Selection.FormatConditions(1).ColorScaleCriteria(2).FormatColor
.Color = 8711167
End With
Selection.FormatConditions(1).ColorScaleCriteria(3).Type = _
xlConditionValueHighestValue
With Selection.FormatConditions(1).ColorScaleCriteria(3).FormatColor
.Color = 7039480
End With
End Sub
I have found out a way. and like to share it with the rest..