Results 1 to 1 of 1

Help with Finding Date based on User Input

Threaded View

  1. #1
    Registered User
    Join Date
    03-29-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    1

    Help with Finding Date based on User Input

    Hi All,

    I'm absolutely useless with VBA, but learning bit by bit. As part of a larger project, I want to have a macro that asks the user for input (of a date) and then finds and selects the cell containing that date. Ideally the date format doesn't matter, but I can deal with that. I could swear the code below was working for me, but then I fiddled with some things and can't get it back again and can't figure out why. I get Runtime Error 13, Type Mismatch. I'm sure this is an easy fix, so any help would be greatly appreciated:


    Sub FindDate()
    
    
    Dim myRange As Range
    Dim myDate As String
    
    
    Set myRange = ActiveSheet.Range("B11, B17")
    myDate = Application.InputBox("Enter Date")
    
    With myRange
        .Find(what:=myDate, After:=Cells(1, 1), LookIn:=xlValues, Lookat:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False).Select
    End With
        
    End Sub
    Last edited by arlu1201; 04-09-2013 at 02:08 AM. Reason: Use code tags in future.

Thread Information

Users Browsing this Thread

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

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