I am learning VBA and to do this have a project.
The userform listbox is sourced from a sheet within the open workbook that is to be hidden when project is complete (in about 6 yrs time at the going rate).
I was working on sorting out the circular calls and how to prevent them e.g listindex = 0 so opened up a second workbook to put my notes in when running my project code in the other workbook when I realised that it could not populate the listbox as it was trying to read from the active workbook! Something I had not thought of!
So, I decided I had better resolve the problem by ensuring that no matter how many spreadsheets the user has open, my code will always look to source the listbox from the project workbook which would of course be open too. Easypeasy thinks me, NOT!
Works fine until but changing it to
It is not accepting the named range. I think I am breaking one of rules of VBA by having .range after .worksheets but cannot work out what I should be doing instead?
Any help/pointers in the right direction appreciated.
Bookmarks