PC Review


Reply
Thread Tools Rate Thread

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

 
 
BCP
Guest
Posts: n/a
 
      4th Mar 2010
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.
 
Reply With Quote
 
 
 
 
FSt1
Guest
Posts: n/a
 
      4th Mar 2010
hi
try this...
sheets("sheet1").Range("A1").Interior.ColorIndex = 3

regards
FSt1

"BCP" wrote:

> 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.

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Application-Defined or object defined error 1004 When ran on exel97 but not 2003 bornweb Microsoft Excel Programming 0 17th Feb 2007 11:30 PM
Copying A Range of Cells From one Sheet to Another - Error Application Defined or Object Defined Matt Microsoft Excel Programming 3 25th Jul 2006 01:13 AM
RE: Runtime error 1004- application defined or object defined erro =?Utf-8?B?Tm92aWNl?= Microsoft Excel Programming 0 6th Feb 2006 09:34 PM
RE: Runtime error 1004- application defined or object defined erro =?Utf-8?B?Tm92aWNl?= Microsoft Excel Programming 1 6th Feb 2006 09:33 PM
RE: Runtime error 1004- application defined or object defined erro =?Utf-8?B?SmltIFRob21saW5zb24=?= Microsoft Excel Programming 0 6th Feb 2006 09:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:47 AM.