jthomas24
jthomas24

Reputation: 11

Wildcards in VBA

Is there a way to do something similar to Cells.find().Activate, but that uses wildcards. I have a drop down list and I want to find and activate the cell on another sheet that has a similar name. For example, in the drop down list there is Muskoka D but on the other sheet it is District of Muskoka. Is that possible?

Upvotes: 1

Views: 822

Answers (1)

Billy Ferguson
Billy Ferguson

Reputation: 1439

You can do it if you change how your drop down list is. If Muskoka D was just Muskoka you could do the following.

In the query of the other dataset do the following in the Column that would contain District of Muskoka

Like "*" & <Drop Down Select Value> & "*"

In our case it would be Muskoka

Like "*" & "Muskoka" & "*"

Would yield all rows that have Muskoka in it. In your example it would yield District of Muskoka and DistrictofMuskoka and MustacheMuskokaDistrict. Basically anything with Muskoka

Upvotes: 1

Related Questions