dpaton05
Well-known Member
- Joined
- Aug 14, 2018
- Messages
- 2,352
- Office Version
- 365
- 2016
- Platform
- Windows
I have a group of about 10 rows that are shaded every second row to aid in reading. My example below has no shading but it does on my spreadsheet.
This is what it looks like. I have added to row number at the start of the row so anyone knows where I am referring too. Obviously, the row number is not in my spreadsheet. The units will change and different rows will have numbers under units and other rows will have 0 at different times.
I have a procedure that runs and it hides the rows that have a 0 under the units so it the example above, the only rows that were not hidden are 20,24,26.
The procedure then prints the document to pdf after the rows have been hidden. In the above example, the output pdf shows the rows to not have any shading as the rows that are still visible are the alternate rows so they are white anyway.
Can someone please help me with vba to shade alternate rows that are visible.
This is what it looks like. I have added to row number at the start of the row so anyone knows where I am referring too. Obviously, the row number is not in my spreadsheet. The units will change and different rows will have numbers under units and other rows will have 0 at different times.
row19 | Units | Price ex. GST | ||
row 20 - Total Hours - Weekday | 51 | $3,564.90 | ||
row 21 - Total Hours - Saturday | 0 | $0.00 | ||
row 22 - Total Hours - Sunday | 0 | $0.00 | ||
row 23 - Total Hours - Public Holidays | 0 | $0.00 | ||
row 24 - Total Nights - Sleepover | 3 | $525.00 | ||
row 25 - Total Nights - Accomodation Costs | 0 | $0.00 | ||
row 26 - Total Days - Activity Costs | 4 | $36.00 | ||
row 27 - Miscellaneous Day Total | 0 | $0.00 | ||
row 28 - Total Kms | 0 | $0.00 |
I have a procedure that runs and it hides the rows that have a 0 under the units so it the example above, the only rows that were not hidden are 20,24,26.
The procedure then prints the document to pdf after the rows have been hidden. In the above example, the output pdf shows the rows to not have any shading as the rows that are still visible are the alternate rows so they are white anyway.
Can someone please help me with vba to shade alternate rows that are visible.