Thread: Adding Colour
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
VBA Noob[_3_] VBA Noob[_3_] is offline
external usenet poster
 
Posts: 1
Default Adding Colour


Thanks Ikaabod.

That worked.

Also got another solution now

Sub FillColors()
Dim c As Range
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.End(xlToRight)).Interior.ColorIndex = 36
Case "b"
Range(c.Offset(0, -2),
c.End(xlToRight)).Interior.ColorIndex = 35
Case "c"
Range(c.Offset(0, -2),
c.End(xlToRight)).Interior.ColorIndex = 34
Case "d"
Range(c.Offset(0, -2),
c.End(xlToRight)).Interior.ColorIndex = 37
Case "e"
Range(c.Offset(0, -2),
c.End(xlToRight)).Interior.ColorIndex = 27
Case "f"
Range(c.Offset(0, -2),
c.End(xlToRight)).Interior.ColorIndex = 40
Case "g"
Range(c.Offset(0, -2),
c.End(xlToRight)).Interior.ColorIndex = 24
Case "h"
Range(c.Offset(0, -2),
c.End(xlToRight)).Interior.ColorIndex = 46
End Select
Next c
End Sub

Danny


--
VBA Noob
------------------------------------------------------------------------
VBA Noob's Profile: http://www.excelforum.com/member.php...o&userid=33833
View this thread: http://www.excelforum.com/showthread...hreadid=536110