Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Trying to shade cells

Using Office 2003 and Windows XP;

I have a sheet containing some 50 rows of merged cells: "G12:H12";
"G13:H13", etc. note: G to H

I want to shade them using something like:

Range(msaGLADAddress(iX)).Interior.ColorIndex = 6

Where msaGLADAddress(iX) is a module level string array containing the
address: "G13:G54"; but I get an error: cannot set the color index. Is there
a way around this? How can I shade these cells without changing the cell
address in the array?

Thanks much.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Trying to shade cells

Just make sure the argument of Range() is, in fact, a string and not a range.

try

MSGBOX(msaGLADAddress(iX)) first
--
Gary''s Student - gsnu200739


"XP" wrote:

Using Office 2003 and Windows XP;

I have a sheet containing some 50 rows of merged cells: "G12:H12";
"G13:H13", etc. note: G to H

I want to shade them using something like:

Range(msaGLADAddress(iX)).Interior.ColorIndex = 6

Where msaGLADAddress(iX) is a module level string array containing the
address: "G13:G54"; but I get an error: cannot set the color index. Is there
a way around this? How can I shade these cells without changing the cell
address in the array?

Thanks much.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Trying to shade cells

You can't color the interior of a subset of cells within a merged set of
cells which it sounds like you are try to do. You can try this.


For each cell in Range(msaGLADAddress(iX))
cell.mergeArea.Interior.ColorIndex = 6
Next

--
Regards,
Tom Ogilvy



"XP" wrote:

Using Office 2003 and Windows XP;

I have a sheet containing some 50 rows of merged cells: "G12:H12";
"G13:H13", etc. note: G to H

I want to shade them using something like:

Range(msaGLADAddress(iX)).Interior.ColorIndex = 6

Where msaGLADAddress(iX) is a module level string array containing the
address: "G13:G54"; but I get an error: cannot set the color index. Is there
a way around this? How can I shade these cells without changing the cell
address in the array?

Thanks much.

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
shade one cell that will shade multiple cells Walt Excel Discussion (Misc queries) 1 November 17th 09 03:46 PM
How to change shade of cells when selecting multiple cells abrummet Excel Discussion (Misc queries) 3 September 6th 07 11:42 AM
Easy way to shade cells andrewc Excel Discussion (Misc queries) 2 June 17th 06 10:18 AM
shade cells superkopite Excel Discussion (Misc queries) 11 January 21st 06 10:33 PM
How do I shade cells using the "IF" function? Kaz Excel Worksheet Functions 3 October 29th 04 02:03 PM


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

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"