Results 1 to 4 of 4

VBA to find a date in a range

Threaded View

  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

    Sub test()
            
            Dim MonthCopy As Variant
            
            MonthCopy = Range(Trim("C1")).Value
            
            Rows("3:3").Select
            Selection.Find(what:=MonthCopy, LookIn:=xlValues, LookAt:=xlWhole, _
            SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:=False).Activate
            
            
    End Sub
    Attached Files Attached Files

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