Pattern Matching with cells function

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi all, I looked for an answer to this one but can't find it. Your
help is always appreciated.

-------------------------
dim bottom as long
bottom = Cells(Rows.count, "B").End(xlUp).Row

For a = bottom To 3 Step -1
If Cells(a, 4) = "*Abstractor" Then
Cells(a - 1, 10) = Cells(a, 7)
Cells(a - 1, 11) = Cells(a, 8)
End If

Next a
--------------------------

It seems to me that the * character is not acting like a wild card for
me. What is the proper way to look through the cells and try to match
a pattern?

Thanks
John
 
John,

Use the LIKE operator. E.g,

If Cells(a,4) Like "*Abstractor" Then



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top