+ Reply to Thread
Results 1 to 6 of 6

Looking for some VBA programming help with a search function

  1. #1
    Registered User
    Join Date
    01-17-2020
    Location
    Corvallis, OR
    MS-Off Ver
    2019
    Posts
    33

    Looking for some VBA programming help with a search function

    I am completely new to VBA and I don't really know where to even begin on this. Basically what I am trying to accomplish is the workbook I am working on has 3 columns and a search cell function. In the search cell would be a manual or scanned input to search Column 1 for the value and highlight the cell in Column 1 if there is a match(No highlight if no match). The first column has a specific number in each column. What I would like to happen is when the manual/scanned input is put into the search box, for it to automatically paste the input into Column 2 and also highlight the column 2 box IF the value is matched to Column 1(Do nothing if it does not). (Column 3 is a match verification if Column 1 Row x matches Column 2 Row x.) I attached 4 files showing the progression of what I would like to accomplish.

    Thank you in advance for any guidance!
    Attached Files Attached Files
    Last edited by Jede; 01-20-2020 at 07:07 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Looking for some VBA programming help with a search function

    Hello Jede,

    I have added the macro below to the attached workbook. This will be triggered when a value is entered into cell "I7". I added Conditional Formatting to columns "C:D" to add the highlight when there is a match.

    Sheet1 Change event Macro
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    01-17-2020
    Location
    Corvallis, OR
    MS-Off Ver
    2019
    Posts
    33

    Re: Looking for some VBA programming help with a search function

    Leith, Thank you so much for the quick response! I tested this out and it seems to work almost exactly as I want it it to. I may not have explained very well though as this all is very new to me. Once you go back to the search function it clears the box from Column 2. Basically I am trying to make it so the input in Column 2 stays both text and highlighted when searching. eventually looking like this(see Attachment)
    Attached Files Attached Files
    Last edited by Jede; 01-20-2020 at 06:21 PM.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Looking for some VBA programming help with a search function

    Hello Jede,

    I removed the line that clears the data when an entry is made. The attached workbook has the change made to it
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-17-2020
    Location
    Corvallis, OR
    MS-Off Ver
    2019
    Posts
    33

    Re: Looking for some VBA programming help with a search function

    Leith, thanks again so much!

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Looking for some VBA programming help with a search function

    Hello Jede,

    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)

Similar Threads

  1. VBA search and retunr results - simple programming
    By renangv in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 04-11-2017, 06:38 AM
  2. Excel 2003 VBA programming search button
    By GutSimLord in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 04-03-2014, 09:00 PM
  3. VBA programming-autofilter function
    By ylchuah in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-10-2011, 03:54 AM
  4. Search and Copy files from a list of file names excel vba programming
    By aashishnawal in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-21-2010, 09:27 AM
  5. programming a search function
    By Don Juan in forum Excel General
    Replies: 14
    Last Post: 07-30-2008, 06:13 PM
  6. programming custom search in excel
    By vjarowdy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-28-2007, 01:57 PM
  7. Programming a Function in VB
    By kdp in forum Excel General
    Replies: 0
    Last Post: 11-30-2005, 05:15 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