+ Reply to Thread
Results 1 to 9 of 9

Finding todays date in column A then select adjacent cell

  1. #1
    Forum Contributor
    Join Date
    10-08-2013
    Location
    London
    MS-Off Ver
    365
    Posts
    136

    Finding todays date in column A then select adjacent cell

    Hi All,

    This may seem simple and most likely is, but I am having a lot of trouble finding todays date in column A then selecting the adjacent cell to the found date to allow data to be pasted in. The macro is run from a form control button on a daily email tally sheet (GI Form Temp.xlsm). The macro should copy figures from the tally sheet to the master stats sheet for the current year (2016 Global Inbox Stats Sheet.xlsm). I get a run time error 1004 at line 85 in the code on Sheet1(GI Count) and am pretty sure this is due to the format of the date on the master stats sheet in column A but can't seem to figure out why....or....it could be the code that searches for the date!

    I have attached both the tally and master workbooks. The section of code I'm having trouble with:

    Please Login or Register  to view this content.
    There are plenty of other issues with a lot of my code(!) which I will get to, but the find date and paste issue is my bugbear for the moment.

    Can anyone please assist me?

    Many thanks,
    Attached Files Attached Files
    Dave C

  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
    48,213

    Re: Finding todays date in column A then select adjacent cell

    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 Contributor
    Join Date
    10-08-2013
    Location
    London
    MS-Off Ver
    365
    Posts
    136

    Re: Finding todays date in column A then select adjacent cell

    Thanks for your prompt reply TMS.

    I have run your code on the 2016 Global Inbox Stats Sheet and got an empty message box. I amended your code with the following but the cell is not being selected.
    Please Login or Register  to view this content.
    What am I missing?

    Many thanks,

  4. #4
    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
    48,213

    Re: Finding todays date in column A then select adjacent cell

    What am I missing?
    That would be data in the cell to display


    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    10-08-2013
    Location
    London
    MS-Off Ver
    365
    Posts
    136

    Re: Finding todays date in column A then select adjacent cell

    Hi TMS, thanks again!

    I can see how your code will give a message box and understand that a lack of data in the cell will give nothing to display (fundamentals!). My issue is that I'm trying to select a cell as per the below amendment but do not get a found date from the code.....until.....I have found that by changing the cell data on the test sheet (2016 Global Inbox Stats Sheet) to an actual date rather than a date derived from a formula, I am getting results.

    Please Login or Register  to view this content.
    Is there a way to get the code to work based on a date derived from a formula (my current cell format as per the test sheet) or will I have to use actual date syntax? I'm hoping I can use what I have otherwise I will need to re-think this!

    Many thanks,

  6. #6
    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
    48,213

    Re: Finding todays date in column A then select adjacent cell

    The code is designed to display the contents of the cell next to the cell matching today's date. It isn't intended to select the cell, given that you rarely need to select anything in order to manipulate it. If you want to select the cell, you will need to activate the workbook, active/select the worksheet, and then select the cell itself. You have all that information, so you should be able to do it.

    Please Login or Register  to view this content.
    Very slow and inefficient though as, no doubt, you'll then need to select the original workbook to do something with the data.


    Not really sure what you are asking regarding dates and formulae. The dates in column A of the 2016 worksheet ARE derived from formula. Row 32:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    = 03 February 2016

  7. #7
    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
    48,213

    Re: Finding todays date in column A then select adjacent cell

    Thanks for the rep.


    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  8. #8
    Forum Contributor
    Join Date
    10-08-2013
    Location
    London
    MS-Off Ver
    365
    Posts
    136

    Re: Finding todays date in column A then select adjacent cell

    Finally got it! All the code needed to be in this workbook, not in the sheet itself. That must have felt like you were extracting teeth!

    Thank you very much for your perseverance with me and for the useful solution. Now on to the other issue with my code - another thread for that!

    Regards,

  9. #9
    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
    48,213

    Re: Finding todays date in column A then select adjacent cell

    You're welcome.

+ 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] Finding Max value in column and returning value from left adjacent cell
    By Haidar123 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-17-2019, 03:33 AM
  2. [SOLVED] Column A & B Match then select cell from a variable adjacent column on same row
    By Belinea2010 in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 08-08-2015, 08:59 PM
  3. Replies: 3
    Last Post: 05-21-2015, 05:27 AM
  4. [SOLVED] List in Combo Box, when new item is selected put todays date in the adjacent column
    By Antligen in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-03-2014, 10:30 AM
  5. Trouble Finding tring in Column and Pulling Adjacent Cell Value
    By rlee12 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-29-2013, 09:48 AM
  6. [SOLVED] Select cell that contains todays date
    By burnsy180 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-18-2012, 08:28 PM
  7. Error in macro for finding todays date
    By Saturn in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 12-12-2011, 03:04 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