always_confused
Board Regular
- Joined
- Feb 19, 2021
- Messages
- 68
- Office Version
- 2016
- Platform
- Windows
Hello,
I have data in certain columns, and I would like to set their interior color so that every other column is green, and the others are blue using VBA. However, I only want the filled cells to be colored, not the entire column.
If I have data in Range("A1:D10"), I would like A1 and C1 to be darker green, and A2-A10 and C2-C10 to be lighter green while B1 are D1 darker blue and B2-B10 and D2-D10 are lighter blue.
I am currently doing this "manually", setting the Interior.ColorIndex for each sub range, which is super annoying. I tried doing it with a loop and columns, but I cannot figure out how to limit the number of rows to be colored to only those with data in them.
Really appreciate any help, thanks.
I have data in certain columns, and I would like to set their interior color so that every other column is green, and the others are blue using VBA. However, I only want the filled cells to be colored, not the entire column.
If I have data in Range("A1:D10"), I would like A1 and C1 to be darker green, and A2-A10 and C2-C10 to be lighter green while B1 are D1 darker blue and B2-B10 and D2-D10 are lighter blue.
I am currently doing this "manually", setting the Interior.ColorIndex for each sub range, which is super annoying. I tried doing it with a loop and columns, but I cannot figure out how to limit the number of rows to be colored to only those with data in them.
Really appreciate any help, thanks.