+ Reply to Thread
Results 1 to 9 of 9

Jump to Today's Date with hyperlink or Macro

  1. #1
    Forum Contributor
    Join Date
    05-28-2016
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    119

    Jump to Today's Date with hyperlink or Macro

    I have a spreadsheet with dates horizontally in row 2.
    I want to be able to click on a hyperlink or a macro button to jump to the cell with the current date in it and preferably highlight the entire column below.

    Thanks in advance

  2. #2
    Registered User
    Join Date
    01-10-2017
    Location
    Pahang, Malaysia
    MS-Off Ver
    2010
    Posts
    41

    Re: Jump to Today's Date with hyperlink or Macro

    can we have the sample spreadsheet file?
    Ajimieta Kuantan

  3. #3
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: Jump to Today's Date with hyperlink or Macro

    .
    .
    This macro is in the Sheet Level module. When the sheet is activated, the macro selects the cell in row 2 with the current date.

    You can take the same code, modify it slightly to work in the ThisWorkbook module Open Event so when the workbook is first opened, it jumps to the current date.
    You can also place the code into a routine module activated by a command button and cause the same effect. Slight modification required.

    Please Login or Register  to view this content.

    For your purposes ... activating by a command button :

    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    05-28-2016
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    119

    Re: Jump to Today's Date with hyperlink or Macro

    I have tried the two options yet the VBA debugger prevents either from running.
    I have attached a file to show my layout.
    I would prefer to have control over when to jump to the date as I will scroll all over the sheet when using it.
    If the entire column could then be highlighted it would help. As well as forcing the column to the far left of the screen while still displaying the split cells from column A & B visible.
    Attached Files Attached Files
    Last edited by Crawfy; 04-04-2017 at 11:26 PM.

  5. #5
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: Jump to Today's Date with hyperlink or Macro

    Please Login or Register  to view this content.
    Added the last three lines to highlight the column.

    You can use the above macro with a command button to activate it. Paste the macro into a routine module.

  6. #6
    Forum Contributor
    Join Date
    05-28-2016
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    119

    Re: Jump to Today's Date with hyperlink or Macro

    Thank you. I will play with the colors.
    Any way to have this jump to the far left rather then the middle of the screen? Any references within excel I could control?

    Any way to return the highlighted column back to original formatting before it was highlighted?
    Last edited by Crawfy; 04-04-2017 at 11:38 PM.

  7. #7
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: Jump to Today's Date with hyperlink or Macro

    Please Login or Register  to view this content.
    Here is a reference for colors : http://access-excel.tips/excel-vba-color-code-list/


    If you change this line:
    Please Login or Register  to view this content.
    to :
    Please Login or Register  to view this content.
    You can use the ColorIndex numbers (on the resource website above) to gain more choices. Place the color number where the ?? marks are.


    It's really late here and I need to sleep. I'll think about the scrolling part tomorrow. Will let you know if I get it put together.

  8. #8
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: Jump to Today's Date with hyperlink or Macro

    .
    .
    If you just want to clear all colors from the sheet ...

    Place this line in its own macro activated by its own command button. Something like:

    Please Login or Register  to view this content.

  9. #9
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: Jump to Today's Date with hyperlink or Macro

    .
    .
    Try this addition to the code ....



    Please Login or Register  to view this content.
    Attached Files Attached Files

+ 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. Enter today date on other sheet from hyperlink
    By unley in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-09-2017, 03:36 AM
  2. [SOLVED] Hyperlink to today's date
    By Trebor777 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-17-2016, 10:41 AM
  3. [SOLVED] Hyperlink to today's date
    By Trebor777 in forum Excel General
    Replies: 10
    Last Post: 09-07-2016, 11:59 AM
  4. [SOLVED] Jump to today's date
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-15-2015, 07:41 PM
  5. [SOLVED] Hyperlink to jump to today's date
    By marcimarc in forum Excel General
    Replies: 3
    Last Post: 12-19-2013, 10:31 AM
  6. Excel 2008 : Jump to today's Column
    By danielwalters6 in forum Excel General
    Replies: 5
    Last Post: 04-15-2010, 01:12 PM
  7. Macro to jump to today's date
    By Victor Delta in forum Excel General
    Replies: 9
    Last Post: 07-04-2006, 04:00 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