PC Review


Reply
Thread Tools Rate Thread

changing background color

 
 
greg
Guest
Posts: n/a
 
      28th Mar 2008
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 With Quote
 
 
 
 
Gord Dibben
Guest
Posts: n/a
 
      28th Mar 2008
Set objRange = Range("C4")
objRange.Interior.ColorIndex = 36


Gord Dibben MS Excel MVP

On Fri, 28 Mar 2008 15:12:55 -0500, "greg" <(E-Mail Removed)> 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
>
>
>


 
Reply With Quote
 
Ken
Guest
Posts: n/a
 
      28th Mar 2008
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" <iu...@ghfhg.com> 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


 
Reply With Quote
 
greg
Guest
Posts: n/a
 
      28th Mar 2008
thanks, I will take a look

"greg" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>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 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
Changing background color Granpoh Microsoft Word Document Management 4 10th Jun 2009 09:15 AM
Background color keeps changing Dan R Windows XP General 1 19th Jan 2009 02:28 AM
Changing background color =?Utf-8?B?VG9wU2NobW8=?= Microsoft Word Document Management 3 3rd Aug 2006 05:03 PM
Changing the Background color uwajes Microsoft Excel Discussion 3 21st Aug 2004 03:41 PM
changing background color -OE kathy Windows XP General 0 16th Aug 2003 03:00 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:08 PM.