Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Fill Color Rows of Varying Size

Hi Guys,

I was wondering if any of you would know how to do this using a macro.
I have data on an excel sheet that looks like follows:

1: A
2: A
3: A
4: B
5: C
6: C

What I want to be able to do is Fill Color the 3 rows with 'A' yellow,
the 1 row with 'B' white, and the 2 rows with 'C' yellow and so on. The
data spans between columns A-J (which means I would need to Fill Color
A1:J3 yellow for example). Does anyone know of a macro that would be
able to do this? Thank you for all your help!

Xavier

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 221
Default Fill Color Rows of Varying Size

Apply conditional formatting to the cells A:J. Here's how:
http://www.officearticles.com/excel/...ft_ excel.htm
*******************
~Anne Troy

www.OfficeArticles.com


"Xavier" wrote in message
oups.com...
Hi Guys,

I was wondering if any of you would know how to do this using a macro.
I have data on an excel sheet that looks like follows:

1: A
2: A
3: A
4: B
5: C
6: C

What I want to be able to do is Fill Color the 3 rows with 'A' yellow,
the 1 row with 'B' white, and the 2 rows with 'C' yellow and so on. The
data spans between columns A-J (which means I would need to Fill Color
A1:J3 yellow for example). Does anyone know of a macro that would be
able to do this? Thank you for all your help!

Xavier



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Fill Color Rows of Varying Size

Hi Xavier,

See xlDynamics CFPlus page at:

http://www.xldynamic.com/source/xld.....Download.html


---
Regards,
Norman



"Xavier" wrote in message
oups.com...
Hi Guys,

I was wondering if any of you would know how to do this using a macro.
I have data on an excel sheet that looks like follows:

1: A
2: A
3: A
4: B
5: C
6: C

What I want to be able to do is Fill Color the 3 rows with 'A' yellow,
the 1 row with 'B' white, and the 2 rows with 'C' yellow and so on. The
data spans between columns A-J (which means I would need to Fill Color
A1:J3 yellow for example). Does anyone know of a macro that would be
able to do this? Thank you for all your help!

Xavier



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Fill Color Rows of Varying Size

Thanks, but the problem is, this pattern repeats a few thousand times.
So for every other set or rows (ie... those containing values A, C, E,
G, I, K, etc), I want to color the cell yellow. The cells containing
the values of B, D, F, H, J, etc would be colored white. The problem
is, the instances of these data values vary. So 'A' could occur 3
times, 'B' could 1 time, C could occur 2 times, D could occur 10 times,
and so on. Therefore, I would need to color fill the entire row
containing varying instances of these values in alternating colors.
Thanks!

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Fill Color Rows of Varying Size

Xavier,

Select your cells, from A1 to J????, and use the formula

=ISODD(CODE($A1))

Then set your fill color to yellow.

HTH,
Bernie
MS Excel MVP


"Xavier" wrote in message
ups.com...
Thanks, but the problem is, this pattern repeats a few thousand times.
So for every other set or rows (ie... those containing values A, C, E,
G, I, K, etc), I want to color the cell yellow. The cells containing
the values of B, D, F, H, J, etc would be colored white. The problem
is, the instances of these data values vary. So 'A' could occur 3
times, 'B' could 1 time, C could occur 2 times, D could occur 10 times,
and so on. Therefore, I would need to color fill the entire row
containing varying instances of these values in alternating colors.
Thanks!





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Fill Color Rows of Varying Size

Ignore my last formula - I forgot that ISODD isn't allowed in CF formulas.

Use thi formula as your CF formula:

=MOD(CODE($A1),2)=1

HTH,
Bernie
MS Excel MVP


"Xavier" wrote in message
ups.com...
Thanks, but the problem is, this pattern repeats a few thousand times.
So for every other set or rows (ie... those containing values A, C, E,
G, I, K, etc), I want to color the cell yellow. The cells containing
the values of B, D, F, H, J, etc would be colored white. The problem
is, the instances of these data values vary. So 'A' could occur 3
times, 'B' could 1 time, C could occur 2 times, D could occur 10 times,
and so on. Therefore, I would need to color fill the entire row
containing varying instances of these values in alternating colors.
Thanks!



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Fill Color Rows of Varying Size

Thanks, but when I do that, it just highlights all my values. I go to
CF, paste the code in (my data starts in A2 so I change it to $A2),
change the fill color to yellow, and hit OK and all the rows that I
highlight turn yellow. Any other suggestions?

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Fill Color Rows of Varying Size

Xavier,

Worked for me. What values do you have in column A? Are they all single letters only? Did you
select your entire table, with the selection starting at cell A2, prior to applying the CF?

If you have problems, contact me privately (take the spaces out and change the dot to . when you
reply to me) and I will send you a working example.

HTH,
Bernie
MS Excel MVP


"Xavier" wrote in message
oups.com...
Thanks, but when I do that, it just highlights all my values. I go to
CF, paste the code in (my data starts in A2 so I change it to $A2),
change the fill color to yellow, and hit OK and all the rows that I
highlight turn yellow. Any other suggestions?



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
highlight subtotal rows with a fill color Deb Raskob Excel Worksheet Functions 1 August 9th 08 06:30 PM
ID and/or filter rows with 'Fill Color' TOMB Excel Worksheet Functions 2 July 24th 07 05:14 PM
Fill Color is added to additional rows Historian Excel Discussion (Misc queries) 2 June 25th 07 08:47 PM
Default cell comment fill color and font size Shadowman13 Excel Discussion (Misc queries) 2 September 28th 05 08:16 PM
sumif range of varying size KM01 Excel Worksheet Functions 2 March 30th 05 10:19 AM


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

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"