K00kykelly
K00kykelly

Reputation: 31

VBA Cells vs Range - Why is Cells not working?

I have the following code in an excel workbook module. Why don't both E106 and G106 turn yellow??

Sub Macro4()
    Worksheets("Thermal Data").Cells(7, 106).Interior.Color = 65535
    Worksheets("Thermal Data").Range("G106").Interior.Color = 65535
End Sub

Upvotes: 0

Views: 387

Answers (1)

Vityata
Vityata

Reputation: 43595

You should be looking in the wrong cell somewhere. Take a look at this, it works:

Sub Macro4()
    Cells(1, 1).Interior.Color = 65535
    Range("A3").Interior.Color = 65535
End Sub

Hint - in the cell the first value is the row, then the column.

Upvotes: 3

Related Questions