+ Reply to Thread
Results 1 to 4 of 4

VBA to find a date in a range

  1. #1
    Forum Contributor
    Join Date
    12-13-2012
    Location
    Shropshire, England
    MS-Off Ver
    Excel 2007 /10 /13
    Posts
    118

    VBA to find a date in a range

    Hi all

    I have the below code, which I have used in other sheets, but I can not seem to get it to work in the attached, it's driving me a little nuts, can some one please point out whatever stupid mistake I am making!


    All I want it to do is find the cell in the row 3 that matches the date in C1
    thanks

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

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: VBA to find a date in a range

    Try this

    Please Login or Register  to view this content.
    You can infact get rid of the Trim if you really want and just have this

    Please Login or Register  to view this content.
    Ofcourse, make sure all Dates are actual dates and not text strings looking like dates.
    Last edited by NeedForExcel; 04-29-2016 at 07:53 AM.
    Cheers!
    Deep Dave

  3. #3
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,104

    Re: VBA to find a date in a range

    Hello BillDoor;

    Try the following code:-


    Please Login or Register  to view this content.
    The code will simply select the date in row 3 that matches the cell C1 date.

    Cheerio,
    vcoolio.

  4. #4
    Forum Contributor
    Join Date
    12-13-2012
    Location
    Shropshire, England
    MS-Off Ver
    Excel 2007 /10 /13
    Posts
    118

    Re: VBA to find a date in a range

    thanks all, that's worked fine for me

+ 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] Macro to find user input date range and delete everything outside range
    By sudric in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-13-2015, 11:52 AM
  2. [SOLVED]Find a closer date for payroll in a range of date
    By jackson_hollon in forum Excel General
    Replies: 9
    Last Post: 10-06-2014, 11:06 AM
  3. Find corresponding date range based on single date and ID number
    By Mate70 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 03-28-2014, 10:56 AM
  4. [SOLVED] look-up a date in a range and find the date that is closest todays date
    By VanShark in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-12-2014, 09:46 PM
  5. Replies: 0
    Last Post: 05-30-2013, 07:50 PM
  6. [SOLVED] find missing date on every group date list based on range and criteria
    By k1dr0ck in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-25-2013, 01:26 AM
  7. Replies: 2
    Last Post: 01-04-2012, 09:15 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