+ Reply to Thread
Results 1 to 3 of 3

wildcard VBA searching

  1. #1
    Registered User
    Join Date
    10-08-2011
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    4

    Question wildcard VBA searching

    Hi,

    I am new to the forum and new to the world of VBA for Excel. Please accept my apologies for any obvious errors that I may miss.

    I have created 2 sheets, one with the data and one which is the user interface.

    The user interface has several command boxes that run VBA 'searchstring' code. These searches refer to specific columns in the data sheet. I have managed with the help of this forum to copy, paste and tweek the code to work for me.

    So far I can successfully enter the search data and have it return the 1st instance of that data and paste the results into the required cell. What I would like to achieve is-

    1) The ability to use wildcards in the search request for when only partial data is known

    e.g. data field contains BROWN - input search data might be BRO*N

    2) for the search box to be able to search the data irrespective of upper or lower case search input

    e.g data field contains BROWN - input search data given as brown

    3) For the search to find all the instances of BROWN and copy all these rows to the nominated cells

    Here is my code so far, I would be very grateful to anyone who can assist and offer some help with this.

    BR Backstop


    Please Login or Register  to view this content.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    re: wildcard VBA searching

    Have you looked at the .Find method in VBA instead of looping? Also, look at Like, both terms should be found in VBA help
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    10-08-2011
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    4

    re: wildcard VBA searching

    Hi royUK,

    I will have a play with those and see what I can come up with.

    Many thanks

    Backstop

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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