+ Reply to Thread
Results 1 to 7 of 7

Locate Today's Date Within Row on Opening Workbook

  1. #1
    Registered User
    Join Date
    06-24-2011
    Location
    North East England
    MS-Off Ver
    Office 365
    Posts
    41

    Locate Today's Date Within Row on Opening Workbook

    Hi there, I've scoured the internet for a few days now trying to find a resolution to my problem but I can't find one that works to fit my specific needs.

    I have a workbook displaying the labour distribution of our company, it has dates along the top (within row 6) which is forecast for a number of years into the future (ie, no specific end date as will be extended over time) and a list of personnell down the left side (column C). What I wish to do it when opening the worksheet (tab named 'Workload') I need the active cell to be on that day's date within row 6.

    I have found numerous bits of VBA code that locates the date within a column but unfortunately cannot find anything that works to locate the current date within a row.

    Really hope you can help and many thanks in advance!

    Liam
    Last edited by liam_bettinson; 08-30-2011 at 07:24 AM.

  2. #2
    Registered User
    Join Date
    06-24-2011
    Location
    North East England
    MS-Off Ver
    Office 365
    Posts
    41

    Re: Locate Today's Date Within Row on Opening Workbook

    PS: I found this thread and the code works when switching between tabs (changed 1:1 and A1 for 6:6 and D6) but not on opening the WB, even when pasted into 'ThisWoorkbook'

    http://excel.bigresource.com/Track/excel-GVrLNQtO/

    Any clues how to modify it to work when opening WB?

  3. #3
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Locate Today's Date Within Row on Opening Workbook

    Hi,

    Try this:

    Please Login or Register  to view this content.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Locate Today's Date Within Row on Opening Workbook

    Please Login or Register  to view this content.

    But for your purpose I think this will be better:
    Please Login or Register  to view this content.
    Last edited by snb; 08-30-2011 at 06:02 AM.



  5. #5
    Registered User
    Join Date
    06-24-2011
    Location
    North East England
    MS-Off Ver
    Office 365
    Posts
    41

    Re: Locate Today's Date Within Row on Opening Workbook

    Domski and SNB, thanks for your replies but neither of those codes worked? Are they meant to be inserted into the Sheet1 code or the ThisWorkbook code?

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Locate Today's Date Within Row on Opening Workbook

    Please use the last amended code in the Thisworkbook module.

    Please post a sample workbook; if the dates have not been inserted/formatted as 'date' the code won't work.(or better: your data don't....)

    cfr. the attachment
    Attached Files Attached Files
    Last edited by snb; 08-30-2011 at 06:10 AM.

  7. #7
    Registered User
    Join Date
    06-24-2011
    Location
    North East England
    MS-Off Ver
    Office 365
    Posts
    41

    Re: Locate Today's Date Within Row on Opening Workbook

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

    But for your purpose I think this will be better:
    Please Login or Register  to view this content.
    Perfect!! Your second piece of code worked a treat, thanks very very much! My headache has now gone

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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