Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2008

Tip: Looking for answers? Try searching our database.

changing background color

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
greg - 28 Mar 2008 21:12 GMT
I am trying to change a background color of a cell.
I would like to do it with out "selecting" the cell.
When I run record a macro I get the following:

   objRange.Font.in
       With Selection.Interior
       .ColorIndex = 36
       .Pattern = xlSolid
   End With

But is there any way to do it by:

   Set objRange = Range("C4")
   objRange.Font.Background ??????

thanks
Gord Dibben - 28 Mar 2008 21:20 GMT
Set objRange = Range("C4")
   objRange.Interior.ColorIndex = 36

Gord Dibben  MS Excel MVP

>I am trying to change a background color of a cell.
>I would like to do it with out "selecting" the cell.
[quoted text clipped - 12 lines]
>
>thanks
Ken - 28 Mar 2008 21:23 GMT
Greg

You should be able to do it without selecting anything with something
like

Range("c4").Interior.ColorIndex = 36
Range("c4").Interior.Pattern = xlSolid

Good luck.

Ken
Norfolk, Va

> I am trying to change a background color of a cell.
> I would like to do it with out "selecting" the cell.
[quoted text clipped - 12 lines]
>
> thanks
greg - 28 Mar 2008 21:32 GMT
thanks, I will take a look

>I am trying to change a background color of a cell.
> I would like to do it with out "selecting" the cell.
[quoted text clipped - 12 lines]
>
> thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.