V
VBA Noob
Hi all,
I've got the below code which I want to reduce down to two lines. Wha
do I need to do Instead of using a upper and lower case "a" & "b"
Code
-------------------
Sub FillColours()
Dim c As Range
Cells.Select
Selection.Interior.ColorIndex = xlNone
For Each c In Range("C1:C" & Cells(Rows.Count, 3).End(xlUp).Row)
Select Case c
Case "*a*"
Range(c.Offset(0, -2), c.Offset(0, 34)).Interior.ColorIndex = 36
Case "A"
Range(c.Offset(0, -2), c.Offset(0, 34)).Interior.ColorIndex = 36
Case "*b*"
Range(c.Offset(0, -2), c.Offset(0, 34)).Interior.ColorIndex = 35
Case "*B*"
Range(c.Offset(0, -2), c.Offset(0, 34)).Interior.ColorIndex = 35
End Select
Next c
End Sub
-------------------
Thanks in advance
VBA Noo
I've got the below code which I want to reduce down to two lines. Wha
do I need to do Instead of using a upper and lower case "a" & "b"
Code
-------------------
Sub FillColours()
Dim c As Range
Cells.Select
Selection.Interior.ColorIndex = xlNone
For Each c In Range("C1:C" & Cells(Rows.Count, 3).End(xlUp).Row)
Select Case c
Case "*a*"
Range(c.Offset(0, -2), c.Offset(0, 34)).Interior.ColorIndex = 36
Case "A"
Range(c.Offset(0, -2), c.Offset(0, 34)).Interior.ColorIndex = 36
Case "*b*"
Range(c.Offset(0, -2), c.Offset(0, 34)).Interior.ColorIndex = 35
Case "*B*"
Range(c.Offset(0, -2), c.Offset(0, 34)).Interior.ColorIndex = 35
End Select
Next c
End Sub
-------------------
Thanks in advance
VBA Noo