Problem: using listbox.value (for sheet name selection) in another procedure results in nothing?
thwuserform.png
Trying to use shtName selection in the list box to use it in another procedure but this is not returning anything after checking debugger. Full code at the end shows that I declared shtName as public and in declarations section (whole code behind userform).
After drilling down, I find shtName variable to be empty.![]()
Please Login or Register to view this content.
Things that I have tried:![]()
Please Login or Register to view this content.
- Putting shtName var in declarations section: Public shtName as worksheet
- Setting shtName to worksheet object using Set keyword.
Is there any other listbox method I should be aware of?
One other question if you could answer:
• How to avoid standard message that states to clear clipboard (at the end of copyData procedure)? Programmatically.
For reference, here is the full code:
![]()
Please Login or Register to view this content.
Bookmarks