Computer Learning Zone CLZ Access Excel Word Windows

Training gives us an outlet for suppressed energies created by stress and thus tones the spirit just as exercise conditions the body.

-Arnold Schwarzenegger
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Excel Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Extended Conditional Format
Gary 

13 years ago
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

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Excel Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/17/2026 9:02:17 PM. PLT: 1s