Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default changing background color

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




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default changing background color

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


Gord Dibben MS Excel MVP

On Fri, 28 Mar 2008 15:12:55 -0500, "greg" wrote:

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




  #3   Report Post  
Posted to microsoft.public.excel.programming
Ken Ken is offline
external usenet poster
 
Posts: 207
Default changing background color

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


On Mar 28, 4:12*pm, "greg" wrote:
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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default changing background color

thanks, I will take a look

"greg" wrote in message
...
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






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
changing background color Numa Excel Discussion (Misc queries) 0 June 10th 08 04:36 PM
changing cell background color okelbes Excel Worksheet Functions 1 September 20th 06 03:28 PM
Changing background color when changing value [email protected] Excel Programming 9 July 6th 06 01:02 PM
Macro for Changing Cell Background Color [email protected] Excel Programming 7 December 2nd 05 05:39 PM
Changing Form Button Background Color wrkoch[_7_] Excel Programming 1 September 20th 04 09:32 PM


All times are GMT +1. The time now is 09:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"