Hello Excel Forum,
I'm a VBA newbie, so please forgive any obvious errors.
I'm stuck in a Do While Loop. I have a user form where a First and Last Name can be entered. When the user clicks a button (Number Check), a worksheet is searched for a Row that contains the First Name (in column C), and the Last Name (in column D). When a row is found with the First and Last Name, a message box displays the row location. This works well if the both First and Last name exist in the spreadsheet. However, if both First and Last names do not exist in the spreadsheet, the program will get stuck in a loop, and i am forced to use Crtl+Pause to exit.
Here's what the spread sheet looks like:
And here's the VBA code:
This is the error I get: Run-time Error '91': Object variable or With block variable not set.
The code is getting hung up at this line:
Any suggestions you may have is greatly appreciated.
Thanks!
-Ryan
Bookmarks