Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using wildcard with variable

Status
Not open for further replies.

UnsolvedCoding

Technical User
Jul 20, 2011
424
US
I am stuck and was hoping someone would know the answer.

Originally this was started in SQL but it crashed the server so it was moved to Excel so others could use the server.

The project I am on has about 250k rows in one spreadsheet and on another spreadsheet has about 1.7 million rows broken into two columns.

I have to check each of the 250k lines against the 1.7 million rows but the information isn't exact. The 250k rows will hold a match or partial match to the 1.7 million rows.

Ideally using like would be great but I can't get the * to work. I have tried "*" & variable_Name & "*" and "*Variable_Name*" and several other variatons. But it doesn't work.

Anyone know how to use a * as a wildcard with a variable?
 
I am running VBA.

The SQL script took up to much of the server and caused problems. I cannot do a SQL script on the server because of needing to match fields, in specific, since there is no direct field to link the join had to be '%' + Id_Nbr + '%' like FileNo.

The end result to get fields that matched was 4 different like statments. So a straight select was used and the results were put into Excel where it is now.

I realize that Excel isn't the best choice, however its what I have to work with.

Given the volume of information and the fact that the cells of one spreadsheet will only be a partial of the cells on the other spreadsheet, I need to find a way to check for like with a variable using VBA.
 

Could you show your actual code where you try to implement the LIKE statement?

Have fun.

---- Andy
 
Also, a few examples of what your input/output look like would be helpful.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top