Application-defined or Object-defined-error when changing color in

  • Thread starter Thread starter BCP
  • Start date Start date
B

BCP

I have tried the following different approaches to chaning the background
color of a cell in an Excell 2007 VBA module and have gotten
Application-defined or Object-defined-error each time. I can display the
color value I just can't seem to be able to change it.

Sheet1.Cells(1, 2).Interior.Color = RGB(126, 255, 126)
Worksheets("sheet1").Cells("A1").Interior.ColorIndex = 3
ActiveSheet.Cells(Cell).Interior.ColorIndex = 255
Range("A1").Cells.Interior.ColorIndex = 1

Any help is welcomed.

Thank you in advance for your help.
 
Back
Top