I am seeking some help and advice on how to set up a userform with a combobox to enable the user to select a specific worksheet from within another workbook.
To give some context, I have a master workbook which holds data on apprentices and tracks their progress. Every month, each of around 30 training providers sends me an update on their learners in the form of a workbook (in a standard format). To make things more efficient, I have written some VBA which automatically imports the data from the updated cells in each workbook into my master workbook. My code makes a number of checks on each worksheet prior to import to make sure the data is valid and this all works perfectly. However, I occasionally receive workbooks which have additional sheets and I would like to add the ability to select the correct worksheet to import. What I'm aiming for is, when multiple sheets are detected in a workbook, a userform pops up with a combobox populated with the worksheet names and asking the user to select which worksheet to import data from. I'm having difficulty understanding how to structure this within my code, which bits of code need to go where and, in particular, how I pass arguments to and from the userform from my main code (I'd prefer to avoid global variables). I believe I need to pass the workbook to the userform so that it can populate the combobox with worksheet names and then pass the selected worksheet back to my main code if that's possible.
I hope this makes sense and any advice would be gratefully received.
Bookmarks