Hello All. I have a spreadsheet where I need to color non-adjacent columns from the column header down to the last active cell. I'm using the VBA below but it's only coloring the header. There are multiple ranges but I'll just show the first two. There are no values in the columns and I just need the shading. This has worked for years and now it doesn't. What am I doing wrong? Please help.
Dim IR As Long
IR = Cells(Rows.Count, "A").End(xlUp).Row
Range("G1:G" & IR).Interior.ColorIndex = 20
Range("I1:I" & IR).Interior.ColorIndex = 20
End Sub
Dim IR As Long
IR = Cells(Rows.Count, "A").End(xlUp).Row
Range("G1:G" & IR).Interior.ColorIndex = 20
Range("I1:I" & IR).Interior.ColorIndex = 20
End Sub