changing background color

G

greg

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
 
G

Gord Dibben

Set objRange = Range("C4")
objRange.Interior.ColorIndex = 36


Gord Dibben MS Excel MVP
 
K

Ken

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top