Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Can i change a fill color in vba?

I am trying to color a selection i have made in vba, is there a command
to do this? Also, I would like to change the font color.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Can i change a fill color in vba?

For example, to fill a cell with yellow:
Selection.Interior.ColorIndex = 6 'yellow

To assign a red font color:
Selection.Font.ColorIndex = 46 'red

Also, why not play with the "record macro" function? From the tools menu,
choose macro, then record macro. Set the color manually and let Excel produce
the macro for you. Then, you can easily find out the correct colorindex for
the color you need!

Regards,
Edwin Tam

http://www.vonixx.com



"Jon" wrote:

I am trying to color a selection i have made in vba, is there a command
to do this? Also, I would like to change the font color.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Can i change a fill color in vba?

yer right, im an idiot. 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
excel 2007 - change fill color from one color to another okiedokiedoo Excel Discussion (Misc queries) 1 December 30th 07 10:25 PM
Change default fill color Harm Ozinga Excel Discussion (Misc queries) 1 February 27th 07 03:00 PM
change fill color of a range of cells based on color of a cell? DarMelNel Excel Programming 0 March 2nd 06 06:35 PM
in excel, how do i change the fill color? [email protected] Excel Worksheet Functions 1 November 29th 05 06:33 PM
Auto fill color change Dave Excel Discussion (Misc queries) 4 June 15th 05 05:45 PM


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

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

About Us

"It's about Microsoft Excel"