Is there another way to write this? Maybe have it look at a list instead of all the "Or" lines?
Please Login or Register to view this content.
Is there another way to write this? Maybe have it look at a list instead of all the "Or" lines?
Please Login or Register to view this content.
for instancePlease Login or Register to view this content.
Josie
if at first you don't succeed try doing it the way your wife told you to
Hi,
The way I usually do this sort of thing is to build a check cell into Excel.
First create a list in Excel of all those cities and name the list say 'Cities'
Then create a cell named say 'rowsearch' which will hold the search row number that you will pass from the macro
Alongside the search row cell add a check cell called say 'check' and enter the formula
Formula:Please Login or Register to view this content.
Now in your macro have the following
Please Login or Register to view this content.
Richard Buttrey
RIP - d. 06/10/2022
If any of the responses have helped then please consider rating them by clicking the small star icon below the post.
Thanks for the responses...Both would definitely simplify the code. Joseph P., would I be able to insert a cell range into the case? Instead of listing all the cities in the string?
Here's and example of what I mean in my second question...
Instead of:Can I make my case a range in excel? something like this?Please Login or Register to view this content.
Please Login or Register to view this content.
no-you would need to use a different approach for that such as the find method or the match/countif worksheetfunction methods
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks