+ Reply to Thread
Results 1 to 4 of 4

Userform search not displaying data

  1. #1
    Registered User
    Join Date
    10-18-2016
    Location
    Frankfurt, Germany
    MS-Off Ver
    2010
    Posts
    82

    Exclamation Userform search not displaying data

    Really struggling to understand why my userform is not displaying the data (Admin tab) into the relevant text box.

    When I click the search button on the userform it just does nothing.

    The IF empty code seems to work though, which is strange...

    This is the code I have used and a sample document is attached. Help is really appreciated!

    Please Login or Register  to view this content.
    Thank you in advance!!
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Userform search not displaying data

    Hi,

    You have an Exit Sub immediately after your first If..End If block

    and unless the characters in the text box are EXACTLY the same cse as in column C you will miss finding a macth. It's always preferable to convert both sides of an if testto either Uper or Lower case. e.g.

    Please Login or Register  to view this content.
    Last edited by Richard Buttrey; 06-17-2020 at 11:46 AM.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    10-18-2016
    Location
    Frankfurt, Germany
    MS-Off Ver
    2010
    Posts
    82

    Re: Userform search not displaying data

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    You have an Exit Sub immediately after your first If..End If block

    and unless the characters in the text box are EXACTLY the same cse as in column C you will miss finding a macth. It's always preferable to convert both sides of an if testto either Uper or Lower case. e.g.

    Please Login or Register  to view this content.
    Richard,

    That's an awesome shout, thank you. I hadn't thought of the lower case until you mentioned it - tested and works great!

    Very silly of me to place the Exit Sub there. My reasoning for this was to prevent the msgBox popping up after the user tries to search with a blank field.

    Are you able to help with that?

  4. #4
    Registered User
    Join Date
    10-18-2016
    Location
    Frankfurt, Germany
    MS-Off Ver
    2010
    Posts
    82

    Re: Userform search not displaying data

    So I movied the Exit Sub before the End If and that looks to have done the job!

    I was getting double message boxes. The second was from the next line of code

+ 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] Userform to search worksheet and display data back to the userform
    By zip247 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-05-2015, 05:46 AM
  3. Replies: 0
    Last Post: 02-27-2014, 04:43 PM
  4. Displaying columnwise data to row form with search
    By SParikh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-17-2014, 08:37 AM
  5. Displaying Excel Sheet data on VBA userform
    By sprasadv in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-30-2013, 06:56 AM
  6. [SOLVED] Do While Loop Issue, in Displaying Data in Userform.
    By scottpattison in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-14-2013, 03:39 PM
  7. Getting data from a spreadsheet and displaying it on a userform
    By benstrowger in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-18-2012, 01:43 PM

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