+ Reply to Thread
Results 1 to 5 of 5

colour tabs by todays date

  1. #1
    Registered User
    Join Date
    04-17-2012
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    6

    colour tabs by todays date

    I have a worksheet which has tabs that go from the 1st of the month to the last. I want to have the current days date tab a different colour to the rest when I first open the sheet ie if its the 17th april that tab is red the rest are another colour) I know I can do this manually but wondered if there is a VBA that will do it when I first open the worksheet?

    I have a VBS that currently automatically opens the correct amount of tabs and names them I wondered if this could be added to?
    Please Login or Register  to view this content.

    I am quite a novice at this and would appreciate any help
    Last edited by royUK; 04-17-2012 at 08:02 AM. Reason: add code tags

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: colour tabs by todays date

    Hi
    try this macro

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: colour tabs by todays date

    This is a slightly different approach - lots of ways to do it. This code needs to be pasted in the Workbook Module. It will auto run when you open the sheet, colour the correct tab and select the current day


    Please Login or Register  to view this content.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: colour tabs by todays date

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    Added this time
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Registered User
    Join Date
    04-17-2012
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: colour tabs by todays date

    Thanks for the codes however I think I must be doing something wrong as it only works when I run the module manually ie alt f11 then f5 this then colours the current days tab. I really wanted this to happen when I open the worksheet other wise its the same as colouring the tab manually each day. Im sure as Im a newbie I am doing something wrong, and help greatfully appreciated.

    P.S Answered it myself with an auto_open command
    Last edited by nnguys; 04-20-2012 at 04:30 PM. Reason: solved my own problem

+ 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