+ Reply to Thread
Results 1 to 6 of 6

VB Font Color based on Letter

  1. #1
    Registered User
    Join Date
    10-27-2008
    Location
    US
    Posts
    5

    VB Font Color based on Letter

    Hello All-

    I am new and trying to figure out visual basics. I have looked high and low on the net and cannot find what I am looking for. I am working with Excel 2007 but have to make it compatible with Excel 2003.

    My situation: I have a workbook for scheduling. The first sheet has the dates for the entire year in Column A and the employee names in Row 2. The next 13 tabs are 28 day increments of time. I would like to enter all of the data on the first tab and have it automatically feed to the other sheets. For example, if I type in "V" for vacation, I want it to appear as Arial Narrow, 10 pt. font and bold. I have approximatly 10 conditions I need to add. Also, the background will remain white in all conditions.

    Thank you!
    aswb
    Last edited by VBA Noob; 03-18-2009 at 03:05 AM.

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573
    You can use Left() to get the first character. You will need to explain the conditions further to get specific help.

  3. #3
    Registered User
    Join Date
    10-27-2008
    Location
    US
    Posts
    5

    Cool Rephrasing Question

    Sorry I was not clear.

    What I am trying to do is enter all information into the first worksheet and have the same information feed to other worksheets within the same workbook. Please pardon my lack of knowledge on how to paste snapshots of what I am doing.

    Worksheet #1
    REFRESH BUTTON
    Please Login or Register  to view this content.
    X - Days Off (black) SL - Sick Leave (pink) V - Vacation (blue) T - Training (orange)
    PL - Personal Leave (green) CF - Conference (aqua)
    H - Holiday (red) A-Authorized Leave (purple)

    ***(desired font colors)


    Worksheet #2 (Information from #1)

    1-Jan 2-Jan 3-Jan 4-Jan 5-Jan 6-Jan 7-Jan

    JILL
    MARY
    BOB
    JOE
    PHIL



    I would like to have the letters be the colors listed above in the entire workbook without having to select each sheet and individually changing each letter for 50 employees for the entire year. I am not sure how to get started.

    Does this make sense? I hope so, I am getting quite frustrated as I have been working on this all weekend and am still far from being done.

    Thanks again,
    aswb

    As a side note: The only other visual basic code I have worked with was already written and I just added the color for the background based on the typed in number in a range of cells. I was able to figure that much out.
    Last edited by shg; 10-27-2008 at 07:31 PM.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436
    This will process the activesheet.
    To make it more dynamic I added a legend table to the sheet. This named range can be expanded to add more codes.
    The font colorindex is picked up from this table.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  5. #5
    Registered User
    Join Date
    10-27-2008
    Location
    US
    Posts
    5

    Thanks

    Thank you! I just checked back after work. I was going to work on it this weekend.

    aswb

  6. #6
    Registered User
    Join Date
    10-27-2008
    Location
    US
    Posts
    5

    Re: VB Font Color based on Letter

    Please marked as solved. thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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