+ Reply to Thread
Results 1 to 5 of 5

Using Find to select cells matching input variable

  1. #1
    Registered User
    Join Date
    06-18-2010
    Location
    Geraldton, Australia
    MS-Off Ver
    Excel 2003
    Posts
    6

    Thumbs up Using Find to select cells matching input variable

    Hi,

    I'm a bit of a novice when it comes to using VBA and am having difficulty getting the macro to find cells that match a date entered via an input box.

    Attached is an example of the file I have started working on. If you click the "Run Balance" button on the Menu sheet it will activate the relevant User Form. Select the "Day" option and enter 30/06/2010 as a date example. The find function doesn't seem to find the date which has been allocated to the variable named Day.

    Any assistance is much appreciated.
    Thanks.
    Attached Files Attached Files
    Last edited by Nanga; 07-03-2010 at 06:13 PM. Reason: Solved

  2. #2
    Registered User
    Join Date
    06-18-2010
    Location
    Geraldton, Australia
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Using Find to select cells matching input variable

    I have just noticed that although the date formula displays as "dd/mm/yyyy" in the vba msgbox, the find dialogue box within the spreadsheet is displaying the date as "mm/dd/yyyy" after the macro has run. Any ideas on preventing this switch in date format?

  3. #3
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: Using Find to select cells matching input variable

    Hi Nanga;
    You have 2 problems with your "Find()"
    1. After:=Cells(17,3) - only works if Worksheets("Prim Balance") is the active sheet, but the active sheet is "Menu"
    You need to use .Cells(17,1) to line up with your "With Worksheets("Prim Balance").Columns("C:C")"

    2. What:= needs to be formatted the same as the formatting of the cells you're looking in.
    Please Login or Register  to view this content.
    Foxguy

    Remember to mark your questions [Solved] and rate the answer(s)
    Forum Rules are Here

  4. #4
    Registered User
    Join Date
    06-18-2010
    Location
    Geraldton, Australia
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Using Find to select cells matching input variable

    Thanks Fox man for taking the time to fault find this. Working perfectly now.

  5. #5
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: Using Find to select cells matching input variable

    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)

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