+ Reply to Thread
Results 1 to 7 of 7

Search userform function

  1. #1
    Registered User
    Join Date
    02-20-2011
    Location
    Dublin
    MS-Off Ver
    Excel 2007
    Posts
    88

    Search userform function

    Hi Guys,

    I am trying unsuccessfully to get a search between 2 dates working on a userform

    I have been working with code form another thread

    And I am getting error every now and again when I run it


    Please Login or Register  to view this content.
    sometimes it works and other times I get "Run-time Error '1004' Method 'Range out of object' worksheet failed"

    I thought I might be down to a pre existing filter and add a clear filter but it still bombs out on this line

    Please Login or Register  to view this content.
    the data it is pulling from the 'Transactions Summary' table looks like this

    Data_Concat Date
    €10 - Voucher 01/01/15
    €50 - Purchase 01/01/16

    Can anyone help me please ?

    TIA
    Sarah

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Search userform function

    It's probably that you have not fully qualified all the ranges with sheet references
    Please Login or Register  to view this content.

  3. #3
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,641

    Re: Search userform function

    Hi there,

    Try using:

    Please Login or Register  to view this content.

    Without fully qualified references, "Cells(i, 1)" and "Cells(j, 2)" will be taken as applying to whichever worksheet happens to be active when the macro reaches that point in its execution.


    Hope this helps - please let me know how you get on.

    Regards,

    Greg M (fellow Dubliner )

  4. #4
    Registered User
    Join Date
    02-20-2011
    Location
    Dublin
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: Search userform function

    Hi Stephen,

    Sorry what does that mean - I'm a VBA newbie ?

    Oh do you mean put sheets("Sheet_name") before it ?

    I have this tho ?
    Please Login or Register  to view this content.
    I did this
    Please Login or Register  to view this content.
    and now I have a Runtime error 1004 - Application-defined or object defined error

    Tis Chilly out there today
    Last edited by Sazza; 11-04-2016 at 08:51 AM.

  5. #5
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Search userform function

    Sarah - wherever you have a reference to a Range or Cells you need to add a sheet reference (put the sheet name or variable name in front). You have done this in most places but below I have filled in a few gaps
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    02-20-2011
    Location
    Dublin
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: Search userform function

    OMG THANK YOU ... I have been trying to get that going for hours ...

    P.s did I mention Thanks

  7. #7
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Search userform function

    My pleasure.

+ 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. Userform, Search, copy an paste data from a userform database to another sheet.
    By masro in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-15-2015, 02:42 PM
  2. [SOLVED] Search Function in UserForm
    By johan12 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-01-2013, 05:56 AM
  3. Userform Search Function Autofilter Results and Repopulate Userform
    By cindy71 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-16-2012, 03:46 PM
  4. [SOLVED] Add search function textbox in userform
    By Nu2Java in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 04-23-2012, 01:47 PM
  5. [SOLVED] Userform Find (VLOOKUP) function search string problem
    By TalResha in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-17-2011, 04:14 AM
  6. UserForm to search sheet, show results on separate userform?
    By egemenkepekci in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-25-2010, 01:06 PM
  7. Userform search and edit function help
    By adjustermn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-08-2010, 03:35 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