I was given the task of cleaning up and organizing our duty schedule, one of the things I was trying to do was standardize the color formatting of the symbol's used in marking events. IE LV=leave MD=medical etc. I found this code you had posted in your excel tips and thought it would work well. I slightly modified it to find text vs a value.
Private Sub Worksheet_Change(ByVal Target As Range) Set I = Intersect(Target, Range("C6:AH47")) If Not I Is Nothing Then Select Case Target Case "LV": NewColor = 37 Case "TD": NewColor = 46 Case "MD": NewColor = 12 Case "RC": NewColor = 10 Case "LC": NewColor = 3 Case "GR": NewColor = 20 End Select Target.Interior.ColorIndex = NewColor End If End Sub
This works great except one thing. Whenever you try to use the mouse to drag copy the text to other Cells it gives a run time error 13 type mismatch It will also do it if I cut and pates to multiple cells. It there a better way I can do this?
Thanks
Gary
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Excel Forum.