ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Fill Color Rows of Varying Size (https://www.excelbanter.com/excel-programming/334648-fill-color-rows-varying-size.html)

Xavier

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


Anne Troy[_2_]

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




Norman Jones

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




Xavier

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!


Bernie Deitrick

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!




Bernie Deitrick

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!




Xavier

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?


Bernie Deitrick

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?





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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com