+ Reply to Thread
Results 1 to 13 of 13

Open workbook to todays date

  1. #1
    Registered User
    Join Date
    04-28-2022
    Location
    Wales
    MS-Off Ver
    365
    Posts
    13

    Open workbook to todays date

    Hi All,

    Need some help, i have a workbook which will have a schedule for machines over a year of dates, per sheet i need to be able to open this workbook to todays date rather than scrolling every day, ive tried a few VBA codes online but nothing has worked, below is a screen grab of the worksheet, any help would be appreciated!

    If this could work to switch to the correct sheet when there are multiple years that would be great, if not i will create a new workbook for each year.


    Capture.PNG

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,853

    Re: Open workbook to todays date

    Welcome to the forum.

    I think this might be what you want: https://www.extendoffice.com/documen...rent-date.html
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    04-28-2022
    Location
    Wales
    MS-Off Ver
    365
    Posts
    13

    Re: Open workbook to todays date

    Thank you, i think that got me half way there, when i open the workbook the correct cell is now selected, but it still only visibly opens row 1 rather than scrolling to the correct row, is that an extra bit of code required?

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,853

    Re: Open workbook to todays date

    I am sure someone will help you with that. Please post the code you have so far.

  5. #5
    Registered User
    Join Date
    04-28-2022
    Location
    Wales
    MS-Off Ver
    365
    Posts
    13

    Re: Open workbook to todays date

    Thanks, I used the code from the link provided.

    Please Login or Register  to view this content.
    Attachment 778522
    Last edited by AliGW; 04-28-2022 at 05:51 AM. Reason: Code tags added - please review the forum rules.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,853

    Re: Open workbook to todays date

    OK, but I was assuming you had changed it to suit your own situation. If not, that's fine.

  7. #7
    Registered User
    Join Date
    04-28-2022
    Location
    Wales
    MS-Off Ver
    365
    Posts
    13

    Re: Open workbook to todays date

    Sorry, I may not have been clear in my original message, i tried a few of the online codes, im not experienced in writing these codes, ive watched a few videos but nothing that explains in too much detail so i wouldn't be sure which parameters to change, that's why I came here looking for advice.

  8. #8
    Valued Forum Contributor
    Join Date
    12-01-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2016
    Posts
    949

    Re: Open workbook to todays date

    you need to have a worksheet named to the current year so that would be 2022 then try below

    Please Login or Register  to view this content.

  9. #9
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2402-17328.20068
    Posts
    1,361

    Re: Open workbook to todays date

    Quote Originally Posted by k1dr0ck View Post
    you need to have a worksheet named to the current year so that would be 2022 then try below

    Please Login or Register  to view this content.
    You can swap the above line with the below if you want it to scroll the screen so that the date cell is top left of screen:
    Please Login or Register  to view this content.
    If things don't change they stay the same

  10. #10
    Registered User
    Join Date
    04-28-2022
    Location
    Wales
    MS-Off Ver
    365
    Posts
    13

    Re: Open workbook to todays date

    Thanks both, I think its kind of working, i was hoping that each time i opened the file it would automatically take me to that cell rather than the last place it left off, is it possible for this script to auto run once the file is opened? it dosent seem to happen automatically when i open the file, unless im missing something.

  11. #11
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2402-17328.20068
    Posts
    1,361

    Re: Open workbook to todays date

    Place the code in the ThisWorkbook module and not a standard module. Then save close and open again.

    The first line of the code makes the macro run on open:
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    04-28-2022
    Location
    Wales
    MS-Off Ver
    365
    Posts
    13

    Re: Open workbook to todays date

    Thank you everyone, the code works great and now ive put it in the right module thing it works over the shared network too!

    Really appreciate your guys help!

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,853

    Re: Open workbook to todays date

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank those who have helped you by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

+ 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. [SOLVED] Open workbook to todays date. with frozen cells
    By nub9l in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-21-2017, 10:03 AM
  2. Auto update all dates in a column to todays date on workbook open
    By smorri25 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-01-2016, 03:12 AM
  3. [SOLVED] Automate todays date upon open workbook
    By TimlmiT in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-18-2013, 08:46 AM
  4. [SOLVED] Open workbook on todays date
    By jshaw82 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-28-2013, 06:32 PM
  5. Cell Value = Todays date on workbook open
    By adam2308 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-08-2010, 05:03 PM
  6. Insert/append todays date when workbook is open
    By evenings in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-29-2010, 10:00 AM
  7. When I open my past invoice it keeps changing date to todays date
    By Stop date changing to todays in Excel in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-07-2005, 12:05 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