Excel VBA colour alternate rows
Solved/Closed
Related:
- Excel VBA colour alternate rows
- Crimping colour code - Guide
- Number to words in excel formula without vba - Guide
- Vba case like - Guide
- Excel marksheet - Guide
- Excel apk for pc - Download - Spreadsheets
2 responses
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Jul 1, 2010 at 04:55 AM
Jul 1, 2010 at 04:55 AM
Could you please upload a sample EXCEL file WITH sample data, macro, formula , conditional formatting etc on some shared site like https://authentification.site , http://docs.google.com, http://wikisend.com/ , http://www.editgrid.com etc and post back here the link
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Jul 1, 2010 at 07:09 AM
Jul 1, 2010 at 07:09 AM
There is number only in last column titled Total. The other columns have either alphanumeric values or dates. Yet you say you want a cell to be highlighted if that cell contains a number
Row 2 contains Total values for the columns below.
Column I contains percentages. I want that value to have red font if it is a minus-values i.e. below 0.
And I need all rows that contains text or value to be alternating light grey and white ( in this document A5:L20.
I can't use conditional formatting because in excel 2002 condition 1 takes over condition 2. So I want to use VBA. But the problem is I'm not good at VBA so I don't know how to create the code.
Column I contains percentages. I want that value to have red font if it is a minus-values i.e. below 0.
And I need all rows that contains text or value to be alternating light grey and white ( in this document A5:L20.
I can't use conditional formatting because in excel 2002 condition 1 takes over condition 2. So I want to use VBA. But the problem is I'm not good at VBA so I don't know how to create the code.
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Jul 1, 2010 at 02:49 PM
Jul 1, 2010 at 02:49 PM
For coloring the values when they are less than 0, you can use regular cell format. You have go to custom format and use this formula
This is for percentages
0.00%;[Red]0.00%
This is for numbers . This you would find under number too. The red one with numbers.
0.00;[Red]0.00
for alternate rows color issue, lets say if a row has data in its any cell, then on that row the column A, MUST and MUST have data too
in that case
Select from from A5 to to last row under column L
Then go to conditional format and enter
=AND($A5<> "", MOD( ROW($A5),2)<>0) and choose your light grey color. Only hitch in this that I can see is that this will color odd number of rows if they have data. So if there is in between blank A, your color scheme might not be what you wanted. What I mean is that if row 15 is grey , row 16 is white, row 17 is blank, then if you expect row 18 to be gray as it has data, then it will not work. It will make row 19 gray if that had data
This is for percentages
0.00%;[Red]0.00%
This is for numbers . This you would find under number too. The red one with numbers.
0.00;[Red]0.00
for alternate rows color issue, lets say if a row has data in its any cell, then on that row the column A, MUST and MUST have data too
in that case
Select from from A5 to to last row under column L
Then go to conditional format and enter
=AND($A5<> "", MOD( ROW($A5),2)<>0) and choose your light grey color. Only hitch in this that I can see is that this will color odd number of rows if they have data. So if there is in between blank A, your color scheme might not be what you wanted. What I mean is that if row 15 is grey , row 16 is white, row 17 is blank, then if you expect row 18 to be gray as it has data, then it will not work. It will make row 19 gray if that had data