I am trying to send user submitted data to up to two different worksheets in excel using vba macro.
I am a beginner and very much still learning the program / vba. I believe I am using the wrong method to assign the sheet, something mis-spelled or the wrong variable type and am seeking assistance.
So far I have debugged the first 'IF' statement. The User has the option to assign an 'Advisor' from a drop down list and enters the if statement.
Next is While, wend. To not get stuck in an infinite loop I have set up two ways to exit the while loop through boolean and count parameters.
My issue resides within the 3rd step (inside the 2nd 'IF' statement). Here we compare the user's drop down selection "frmNewCust.cmbAdvisor.Value" to the first cell in a list of names "shMaster.Cells(searchRow, 9)". The While statement works down the list until it finds its match.
It gives me an error: (https://i.stack.imgur.com/PnEL0.png)
and highlights this line while debugging: (https://i.stack.imgur.com/LsQ0z.png)
I am guessing I dont have the correct Variable type, or am not referring to the correct cell's 'value' (the name of the worksheet I'd like to copy the date to). Any help would greatly be appreciated.
Here's an image of the majority of the code in question: (https://i.stack.imgur.com/tVXTv.png) (https://i.stack.imgur.com/1uOYF.png)