+ Reply to Thread
Results 1 to 9 of 9

When workbook open it show the sheet have today date

  1. #1
    Forum Contributor
    Join Date
    05-01-2013
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    165

    When workbook open it show the sheet have today date

    I have a workbook with 31 sheets, like 1,2,3,4 up to 31 one sheet for each day. Is there way I can set my workbook, when it open it open up the sheet have today date in cell a1 or sheet name 1.
    like today is 18th july so it will open a sheet 18 or any of my sheet have cell a1 date 18th

    Thanks
    RR
    Last edited by robrobet; 07-18-2013 at 11:53 AM.

  2. #2
    Registered User
    Join Date
    02-22-2011
    Location
    Staffordshire
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: When workbook open it show the sheet have today date

    Hi RR

    Try this

    Please Login or Register  to view this content.
    It needs to be copied in to the Workbook Open Event

    Hope it helps

  3. #3
    Forum Contributor
    Join Date
    05-01-2013
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    165

    Re: When workbook open it show the sheet have today date

    It show me a error, Becuase my sheet is protected. do I have to unprotect my sheets or cell a1 ? or is there way I can put my pasword in this code so I do not need to unprotect my sheet or cell.
    Last edited by robrobet; 07-18-2013 at 12:08 PM.

  4. #4
    Registered User
    Join Date
    02-22-2011
    Location
    Staffordshire
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: When workbook open it show the sheet have today date

    Hi RR

    Try the below.

    You will have to add your password inside the speech marks.

    Downside of this is your passwords are on view if users know how to get at code :-(

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    05-01-2013
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    165

    Re: When workbook open it show the sheet have today date

    Hi Hawkwind,

    Somthing I am not doing right here, if i put my password in it the it give a error the password I supply is not correct. if I unlock all the sheet and paste the code with password "123" in speech marks then it work fine but if I try to unlock the sheet with password "123" then I get message my password is not right. then I am unable to unlock this sheet.

    if i paste this code as it show then what will be my password ?

  6. #6
    Registered User
    Join Date
    02-22-2011
    Location
    Staffordshire
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: When workbook open it show the sheet have today date

    Apologies RR

    I missed the two dots :

    Please see below

    Please Login or Register  to view this content.
    Hope this helps and sorry for the missing bits :-)

  7. #7
    Forum Contributor
    Join Date
    05-01-2013
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    165

    Re: When workbook open it show the sheet have today date

    Hi Hawkwind,

    Thanks for your help this code work fine, do not say sorry mistake happen.
    do we able to change this code to work if the workbook only have tab 1 to 31 and vba look for the tab name match with today date and open up that sheet. the code above insert the date in cell a1 but if I do not want to put the date anywhere on my sheet. I have few other workbook that I want to change it when they open it show the tab that equal to today date. I know i can chose the code above and may be use the cell a65000 but I want vba that only look for tab name.

    Thanks
    RR

  8. #8
    Registered User
    Join Date
    02-22-2011
    Location
    Staffordshire
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: When workbook open it show the sheet have today date

    Hi RR

    I misunderstood your request.

    Please Login or Register  to view this content.
    The above code will select the sheet name 1 to 31 based on the day opened e.g. 24/07/2013 would mean sheet no 24 would be opened.
    The removed code only added the Date value to the sheet as I thought that was what you wanted. The password part was required to add the date value so this is also not needed.

    Cheers
    Hawkwind

  9. #9
    Forum Contributor
    Join Date
    05-01-2013
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    165

    Re: When workbook open it show the sheet have today date

    Hi Hawkwind,
    It works the way I want to see.
    Thank you for your time and help.
    RR

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 01-29-2013, 09:19 PM
  2. [SOLVED] sort by date, show records with only dates less than 30 days from today, and count....
    By pbucc in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-22-2012, 12:11 PM
  3. [SOLVED] Show today's date on calendar
    By Marco-Kun in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-26-2012, 04:23 PM
  4. Show today's date if specified cell is modified
    By xavpg in forum Excel General
    Replies: 7
    Last Post: 02-28-2012, 07:16 PM
  5. Replies: 4
    Last Post: 11-25-2009, 08:10 PM

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