+ Reply to Thread
Results 1 to 13 of 13

Userform search issue

  1. #1
    Registered User
    Join Date
    07-10-2018
    Location
    Uk
    MS-Off Ver
    MS365 Version 2102
    Posts
    86

    Userform search issue

    Hello All,

    I am tried to created a Search userform with a listbox but I am getting a 'Runtime error 1004' I have underlined the code below.

    Has anyone got any ideas why this might be happening?

    Many Thanks



    Please Login or Register  to view this content.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Userform search issue

    When you get the error what is the value in SearchColumn?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    07-10-2018
    Location
    Uk
    MS-Off Ver
    MS365 Version 2102
    Posts
    86

    Re: Userform search issue

    Quote Originally Posted by Norie View Post
    When you get the error what is the value in SearchColumn?
    The value is "DrawingNumber"

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Userform search issue

    Is there definitely a column with the exact name 'DrawingNumber' in a table with the exact name 'Table5'?

  5. #5
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,313

    Re: Userform search issue

    A cleaner method employing filtering - no messy clunky additems
    You can replace the comboboxes with textboxes if you wish.
    torachan.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    07-10-2018
    Location
    Uk
    MS-Off Ver
    MS365 Version 2102
    Posts
    86

    Re: Userform search issue

    Quote Originally Posted by Norie View Post
    Is there definitely a column with the exact name 'DrawingNumber' in a table with the exact name 'Table5'?
    Okay I have checked and now only DrawingNumber column appears to be working, Iam not getting any results in any other column?

  7. #7
    Registered User
    Join Date
    07-10-2018
    Location
    Uk
    MS-Off Ver
    MS365 Version 2102
    Posts
    86

    Re: Userform search issue

    Quote Originally Posted by torachan View Post
    A cleaner method employing filtering - no messy clunky additems
    You can replace the comboboxes with textboxes if you wish.
    torachan.
    I would like to stick to my eaxmple if possible because I would like to be able to delete search results from the list box eventually

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Userform search issue

    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  9. #9
    Registered User
    Join Date
    07-10-2018
    Location
    Uk
    MS-Off Ver
    MS365 Version 2102
    Posts
    86

    Re: Userform search issue

    Quote Originally Posted by Norie View Post
    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Attached below
    Attached Files Attached Files
    Last edited by Ashleytaylor1702; 12-10-2020 at 01:44 PM.

  10. #10
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Userform search issue

    You are missing the End If for the DrawingNumber If but you seemed to have added an 'extra' End If' at the bottom of the code and that's allowed the code to compile.

  11. #11
    Registered User
    Join Date
    07-10-2018
    Location
    Uk
    MS-Off Ver
    MS365 Version 2102
    Posts
    86

    Re: Userform search issue

    Quote Originally Posted by Norie View Post
    You are missing the End If for the DrawingNumber If but you seemed to have added an 'extra' End If' at the bottom of the code and that's allowed the code to compile.
    Thanks for that, Only issue is now I only appear to have 4 columns within the listbox? See screenshot

    Attachment 708151

    Also what would be the best way to add a delete function?

  12. #12
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Userform search issue

    I'm afraid the attachment didn't work.

    Had a look at the file though and you've set the column count of the listbox to 4 in it's properties and you don't appear to change that in the code.

  13. #13
    Registered User
    Join Date
    07-10-2018
    Location
    Uk
    MS-Off Ver
    MS365 Version 2102
    Posts
    86

    Re: Userform search issue

    Quote Originally Posted by Norie View Post
    I'm afraid the attachment didn't work.

    Had a look at the file though and you've set the column count of the listbox to 4 in it's properties and you don't appear to change that in the code.
    Thanks for you Help all working now

+ 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] VBA Userform to search data in a table filtering results based on all search criteria
    By matt7416 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-05-2020, 05:09 AM
  2. Userform Search when search two text boxes return multiple results
    By nekiwa07 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-29-2020, 09:42 AM
  3. Search and display results in userform Issue. Results are incorrect
    By olypro in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-07-2019, 10:16 AM
  4. [SOLVED] modify userform search to search the whole wookbook instead of single sheet
    By danbates in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-27-2017, 12:58 PM
  5. 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
  6. Lookup Formula Issue, Search issue
    By kperitz in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 04-07-2014, 01:50 PM
  7. [SOLVED] Userform Listbox Search issue
    By cmmercer in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-21-2014, 07: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