+ Reply to Thread
Results 1 to 3 of 3

Auto change colour of cell when text / letter entered into cell

  1. #1
    Registered User
    Join Date
    12-22-2007
    Posts
    10

    Auto change colour of cell when text / letter entered into cell

    Hi guys,

    Again I found another very helpful bit while trying to update my report.

    We had a sheet for staff leave, and I needed more than 3 options for conditional formatting, so I found some VB code and modified it as below.

    This gave me multipul options that did multipul colors. When I type the letter the cell turns the corresponding color;

    W = Yellow
    S = Green
    SN = Sky Blue
    B = Purple
    P = Light purple
    A = Dark Yellow
    BR = Grey
    J = Dark Orange
    V = Light blue

    -> Right click on worksheet and choose 'view code' - past the below anad modify cell ref's as appropriate


    Please Login or Register  to view this content.
    Yay - works a treat
    Last edited by VBA Noob; 12-26-2007 at 05:34 AM.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    You can shorten by using the Ucase function

    More examples of select case here

    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    12-22-2007
    Posts
    10
    Cheers,

    I was wondering after I had finished if I could shorten this by using comma's on the same line as you have suggested - "W", "W.5"

    I had no idea abaout Ucase though to cover both upper & lower case.

    Thanks for hte tip that will tidy up the script nicley

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1