davidhasselhoff
New Member
- Joined
- Feb 12, 2009
- Messages
- 37
Hello!
I got a listbox which chooses from which worksheet a value should be copied.
Now If there is a value in the listbox, where there is no corresponding worksheet, I get an "out of range" error.
What I need is a way to check if there is a worksheet called as the choice the user makes to produce an error/cancel/go back message if there isn't.
Here is the code i use:
Any help would be greatly appreciated!
I got a listbox which chooses from which worksheet a value should be copied.
Now If there is a value in the listbox, where there is no corresponding worksheet, I get an "out of range" error.
What I need is a way to check if there is a worksheet called as the choice the user makes to produce an error/cancel/go back message if there isn't.
Here is the code i use:
Code:
Cells(11, 3) = ThisWorkbook.Worksheets(UserFormsea.ListBox3.Text).Range("b29")
Any help would be greatly appreciated!