+ Reply to Thread
Results 1 to 8 of 8

VBA: goto cell in column A:A that contains date of sunday for curent week.

  1. #1
    Registered User
    Join Date
    05-09-2012
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    26

    VBA: goto cell in column A:A that contains date of sunday for curent week.

    I have looked everywhere and unable to locate my answer. is is possible to write some VBA code that would, at the click of a button, go to the cell in Column A that contains the date for Sunday of the current week.

    Column A contains dates that fall on every Sunday from start of 2014 - 12/9/2029.

    example:
    Current week is 11/23/2014-11/29/2014
    Today is 11/25/2014
    Current Weeks Sunday date is 11/23/2014

    then when opening the book I could potentially be in cell A1 but click a button and it takes me to cell A52 which actually contains 11/23/2014 which is the current weeks Sunday date.

    Apologies in advance if i am unclear or confusing.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,434

    Re: VBA: goto cell in column A:A that contains date of sunday for curent week.

    Please Login or Register  to view this content.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: VBA: goto cell in column A:A that contains date of sunday for curent week.

    Please Login or Register  to view this content.

    if you want it to open on that cell whenever you open the book then put the code into the Workbook_Open event
    If someone has helped you then please add to their Reputation

  4. #4
    Registered User
    Join Date
    05-09-2012
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: VBA: goto cell in column A:A that contains date of sunday for curent week.

    That worked great thank you.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,434

    Re: VBA: goto cell in column A:A that contains date of sunday for curent week.

    That worked great thank you.
    What did? You had two very different solutions. And I think the second will select the current date.

    Regards, TMS

  6. #6
    Registered User
    Join Date
    05-09-2012
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: VBA: goto cell in column A:A that contains date of sunday for curent week.

    Quote Originally Posted by TMS View Post
    What did? You had two very different solutions. And I think the second will select the current date.

    Regards, TMS
    this one that you supplied:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    05-09-2012
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: VBA: goto cell in column A:A that contains date of sunday for curent week.

    Quote Originally Posted by pjwhitfield View Post
    Please Login or Register  to view this content.

    if you want it to open on that cell whenever you open the book then put the code into the Workbook_Open event
    If they cant click a button, then they can just scroll. lol
    but the code works great. i just tested it but it doesn't have to go to the date upon open as their is a graph at the top that should always be displayed first.

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,434

    Re: VBA: goto cell in column A:A that contains date of sunday for curent week.

    Ah, OK. Just checked the other routine. It goes to the day after today.

    If you did want a routine to go to today's date, you could modify it to:

    Please Login or Register  to view this content.

    Or, modify my code to:

    Please Login or Register  to view this content.

    Regards, TMS

+ 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] Formula to determine date of Sunday from last week
    By tahoeast in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-13-2022, 08:44 AM
  2. VBA - Date required for Monday & Sunday of week previous
    By wotadude in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-18-2011, 03:14 PM
  3. Curent date in a chart?
    By BengtLa in forum Excel General
    Replies: 3
    Last Post: 03-18-2011, 07:17 AM
  4. Sunday of last week
    By ice in forum Excel General
    Replies: 2
    Last Post: 11-02-2010, 05:55 PM
  5. [SOLVED] get a runing total for"curent date"or(cell)minus prev 30 days( cel
    By dustin in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-01-2006, 05:05 AM

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