+ Reply to Thread
Results 1 to 3 of 3

VBA for search function is not working

  1. #1
    Registered User
    Join Date
    05-17-2021
    Location
    india
    MS-Off Ver
    2016
    Posts
    1

    VBA for search function is not working

    Hi All,

    I am new to excel vba and need to fix an issue for searching data from the database. I need to search for an ID which is in C column of Database sheet and get the values visible in all the respective fields in form. I tried to my level best but couldn't fix. Attached the excel sheet for your reference. Kindly advise.

    Thanks all.

    With Regards,
    Saravanan R
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,946

    Re: VBA for search function is not working

    Use the Match function like so:

    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: VBA for search function is not working

    Hi Saravanan & welcome to the forum

    Try below code ...
    Please Login or Register  to view this content.
    Edit: Just noticed that your data in "form" sheet is in the same order of "database" sheet so below code works without loops ...
    Please Login or Register  to view this content.
    Last edited by nankw83; 05-17-2021 at 03:53 PM. Reason: Added a code
    If I was able to help, you can thank me by clicking the * Add Reputation under my user name

+ 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] Search Function Working In Some Cells But Not Others
    By Jayabarreno in forum Excel General
    Replies: 2
    Last Post: 12-09-2020, 07:03 PM
  2. Search and Edit Form, Search not working correctly
    By rob_h in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-23-2017, 03:48 PM
  3. [SOLVED] Trim Function not working in Worksheet Search box
    By Faridwahidi in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-11-2014, 09:09 PM
  4. IF(count(search) Function not working when search from text from a cell
    By joshnathan in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-09-2013, 05:13 AM
  5. [SOLVED] Struggling to get a small search function working correctly
    By bodhi808 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-17-2013, 08:34 PM
  6. Replies: 1
    Last Post: 10-18-2012, 05:52 AM
  7. Vlookup function not working if alphabet coming after '-' in the search term
    By ElerOcean in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-15-2007, 11:40 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