FalconFlyer
New Member
- Joined
- May 18, 2015
- Messages
- 30
I have 2 columns (F and G) that I would ultimately run this macro on. Column F is formatted as numbers and Column G is %. The macro works on Column F, but returns "Type Mismatch" for G. Not sure what I am doing wrong.
Can I combine it to apply to both F and G? What am I doing wrong?
TIA
Code:
Dim LastRow As Long
Dim r As Long
Application.ScreenUpdating = False
' Find last populated cell in column A
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
' Loop through all rows starting from row 2
For r = 3 To LastRow
Select Case Cells(r, "G")
Case Is < 0
Range(Cells(r - 1, "G"), Cells(r, "G")).Interior.Color = RGB(247, 196, 187)
Case Is > 0
Range(Cells(r - 1, "G"), Cells(r, "G")).Interior.Color = RGB(200, 239, 195)
End Select
Next r
Application.ScreenUpdating = True
Can I combine it to apply to both F and G? What am I doing wrong?
TIA