+ Reply to Thread
Results 1 to 6 of 6

Create a button that will find today's date in a spreadsheet.

  1. #1
    Registered User
    Join Date
    07-18-2014
    Location
    Lexington, KY
    MS-Off Ver
    2007
    Posts
    29

    Create a button that will find today's date in a spreadsheet.

    I would like to create a button that will find “today’s” date on my spreadsheet. The actual file is much longer, it covers 13 months, so being able to move directly to the current date would be helpful. In the example, A1 in the Tracker Tab is derived from the user’s input from the Limits Tab. Subsequent dates, A2 and below, are derived by adding 1 to the date above. If today were Dec 12th and I was looking at data from March, it would be helpful to press a button and have it scroll all the way back to 12 Dec 15.
    Attached Files Attached Files

  2. #2
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2409
    Posts
    2,789

    Re: Create a button that will find today's date in a spreadsheet.

    Try this.
    Please Login or Register  to view this content.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Create a button that will find today's date in a spreadsheet.

    Another - non-VBA - option would be to use teh HYPERLINK function...
    =HYPERLINK("#"&"A"&MATCH(TODAY(),A:A,0),INDIRECT("A"&MATCH(TODAY(),A:A,0)))

    This will show the contents of the cell containing the date. If you would prefer the cell ref to show instead...
    =HYPERLINK("#"&"A"&MATCH(TODAY(),A:A,0),"A"&MATCH(TODAY(),A:A,0))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    07-18-2014
    Location
    Lexington, KY
    MS-Off Ver
    2007
    Posts
    29

    Re: Create a button that will find today's date in a spreadsheet.

    Thank you both for the reply.

    The code returned the "Today not found..." msg box. I'm still learning code so I don't know what the issue may be.

    I tried the hyperlink option and it is successful, I think... I don't know how to implement that into a button so I put it in a cell. The cell thing did work. Is it possible to have "Today" displayed instead of blank or the matching cell? That would be great... or, can you provide instruction on how to implement your solution into a button?

    Thanks again to both!

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Create a button that will find today's date in a spreadsheet.

    Quote Originally Posted by slindfors View Post

    I don't know how to implement that into a button so I put it in a cell. The cell thing did work. Is it possible to have "Today" displayed instead of blank or the matching cell? That would be great... or, can you provide instruction on how to implement your solution into a button?
    TYou dont need a button, just click the hyperlink in that cell.

    If you just want TODAY shown, change to...
    =HYPERLINK("#"&"A"&MATCH(TODAY(),A:A,0),"Today")

  6. #6
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2409
    Posts
    2,789

    Re: Create a button that will find today's date in a spreadsheet.

    The code returned the "Today not found..." msg box. I'm still learning code so I don't know what the issue may be.
    My guess would be the workbook you are using it on is somehow different than that which you posted.
    Date format perhaps.
    My code looks at how the date in cell A1 is formatted, maybe your actual sheet doesn't have a date in A1?
    I would have to see what the difference is.
    It works with the workbook you posted.
    Attached Files Attached Files
    Last edited by skywriter; 12-03-2015 at 03:24 PM.

+ 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] Button to scroll to today's date
    By brucemc777 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-25-2013, 01:35 PM
  2. Create button on spreadsheet when clicked record date stamp in the next column
    By HBHB in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-02-2013, 06:52 PM
  3. Macro button to find today's date
    By razor_raef in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 07-08-2013, 11:23 PM
  4. VBA | Find Today's Date by Command Button
    By maintguy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-11-2012, 01:04 PM
  5. create a find button in the excel spreadsheet
    By torontoguy in forum Excel General
    Replies: 3
    Last Post: 01-15-2009, 11:28 AM
  6. create a macro to alert me if today's date is within 5 days of expected delivery date
    By ashmcclure in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 09-25-2008, 05:51 PM
  7. Replies: 3
    Last Post: 06-01-2008, 04:55 PM
  8. how to create a new sheet with today's date
    By mangesh in forum Excel General
    Replies: 1
    Last Post: 03-17-2006, 05:15 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