+ Reply to Thread
Results 1 to 10 of 10

"Goto" function or macro

  1. #1
    Forum Contributor jason.hampton's Avatar
    Join Date
    04-20-2012
    Location
    Republic of Texas
    MS-Off Ver
    2007, 2010, 2016
    Posts
    138

    "Goto" function or macro

    All,

    I would like to ask if there is a way to "goto" today's date in the attached worksheet. I have selected row 4 and added simply conditional formatting for "This Week". My goal would be to have a hyperlink or macro to take you back today's date from anywhere in the document.
    Attached Files Attached Files
    Best Regards,

    Jason Hampton
    Freedom Isn't Free

  2. #2
    Forum Contributor
    Join Date
    09-25-2009
    Location
    Indiana
    MS-Off Ver
    Excel 2003
    Posts
    152

    Re: "Goto" function or macro

    Needs some work, but this might work as a macro....

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor jason.hampton's Avatar
    Join Date
    04-20-2012
    Location
    Republic of Texas
    MS-Off Ver
    2007, 2010, 2016
    Posts
    138

    Re: "Goto" function or macro

    Hood,

    Thank you. A work colleague just hooked me up; I tweaked it and added some features to it. Then I pasted an image onto the top of the page and assigned this macro to it. It works great! I have tried it on several different worksheets. If I am not on the correct sheet, the error message pops up "Date Not Found. Are you on the correct worksheet?".

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    09-25-2009
    Location
    Indiana
    MS-Off Ver
    Excel 2003
    Posts
    152

    Re: "Goto" function or macro

    Hell Jason,

    Just add Sheet2.Select to the code like this...

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor jason.hampton's Avatar
    Join Date
    04-20-2012
    Location
    Republic of Texas
    MS-Off Ver
    2007, 2010, 2016
    Posts
    138

    Re: "Goto" function or macro

    Hood,

    I really appreciate the feedback! Can you explain what function does "Sheet2.Select" perform? I have never utilized this syntax.

  6. #6
    Forum Contributor jason.hampton's Avatar
    Join Date
    04-20-2012
    Location
    Republic of Texas
    MS-Off Ver
    2007, 2010, 2016
    Posts
    138

    Re: "Goto" function or macro

    I tried that syntax in my workbook with many worksheets. It directs me to my "contacts" worksheet, and the error message pops up.

  7. #7
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: "Goto" function or macro

    Hello jason.hampton,

    Maybe something as per the attached sample Workbook?

    Regards.
    Attached Files Attached Files
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  8. #8
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: "Goto" function or macro

    FWIW:

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    09-25-2009
    Location
    Indiana
    MS-Off Ver
    Excel 2003
    Posts
    152

    Re: "Goto" function or macro

    Sheet2.Select activates Sheet2. It looks like Sheet2 in your current workbook is named "contacts".
    You could use Sheet("Jan - June 2015").Select


    I like John's Code....
    Maybe this, I don't know...

    Please Login or Register  to view this content.

  10. #10
    Forum Contributor jason.hampton's Avatar
    Join Date
    04-20-2012
    Location
    Republic of Texas
    MS-Off Ver
    2007, 2010, 2016
    Posts
    138

    Re: "Goto" function or macro

    Hood,

    I saved your test as an .xlsm file. Then copied your syntax and button into my larger workbook. It seems to work flawlessly. I've added to both you and John's reputation.

+ 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] Excel 2010 -- "Visual Basic" "Macros" and "Record Macro" all disabled.
    By NicholasL in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-07-2017, 06:11 AM
  2. [SOLVED] GOTO sucks, but can I "GOTO Variable"?
    By smpita in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-25-2014, 03:14 PM
  3. GoTo compile error: "Expected: line number or label"
    By elfsprin in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-29-2011, 09:21 PM
  4. How can i copy value from "HTMLText"(EMBED("Forms.HTML:Text","")),using Macro
    By andrewyang in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2010, 12:47 AM
  5. Alternative to "On Error GoTo 0" that takes macro to last command?
    By StargateFan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-25-2006, 01: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