Hi there.
I will have a spreadsheet similar to the image provided. Basically, I need the macro to go row by row down column I. If the cell in column I contains the word "Tech" I need the cells from column B to P to be shaded color1; if it contains "Update," color 2; if the cell is blank; leave the cell as is. Once the macro has done this, it will continue to the next row and to the same check.
The number of rows in the spreadsheet will change on a day-to-day basis depending on the data that's pulled, but the columns should remain the same.
So I think I have the shading part. This is what I have so far. I'm not sure if this is the most efficient way of coding it, but it kinda works. I guess another problem would be if in the future the column with this info (column I) changes and shifts.
![]()
Sub Shading() ActiveSheet.Range("I3").Select If Range("I3") = "Tech" Then Range("C3:P3").Select With Selection.Interior .ColorIndex = 36 .Pattern = xlSolid End With ElseIf Range("I3") = "Updates" Then Range("C3:P3").Select With Selection.Interior .ColorIndex = 34 .Pattern = xlSolid End With End If End Sub
I've been trying to figure something out, but I haven't been able to wrap my brain on how to do this.
Thanks to all for any help you can provide.
Bookmarks