Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am getting an error with the Me object, I have virtually no VBA experience
and as such I have no idea what other object to use here... Private Sub Color_G6() Dim Num As Long Dim rng As Range Set rng = Me.Range("G6") On Error GoTo endit Application.EnableEvents = False 'Determine the color Select Case UCase(rng.Value) Case Is = "BLUE": Num = 5 'blue Case Is = "ORANGE": Num = 45 'orange Case Is = "GREEN": Num = 10 'green Case Is = "BROWN": Num = 53 'brown Case Is = "SLATE": Num = 15 'slate Case Is = "WHITE": Num = 1 'black Case Is = "RED": Num = 3 'red Case Is = "BLACK": Num = 1 'black Case Is = "YELLOW": Num = 6 'yellow Case Is = "VIOLET": Num = 54 'violet Case Is = "ROSE": Num = 38 'rose Case Is = "AQUA": Num = 42 'aqua End Select 'Apply the color rng.Font.ColorIndex = Num endit: Application.EnableEvents = True End Sub Thanks, Todd |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I copy color text & paste keeping color | Excel Discussion (Misc queries) | |||
Can't format cell color/text color in Office Excel 2003 in fil | Excel Discussion (Misc queries) | |||
Make text color match cell color with macro? | Excel Discussion (Misc queries) | |||
Cond. format text color based on another's text color | Excel Discussion (Misc queries) | |||
Can't format cell color/text color in Office Excel 2003 in files . | Excel Discussion (Misc queries) |