jeffreybrown
Well-known Member
- Joined
- Jul 28, 2004
- Messages
- 5,152
I found DropDown.zip on Ron de Bruin's site which adds a dropdown to the ribbon and holds values from a worksheet range. I thought I could use these values to naviagate to a worksheet with the same name. At the end the the procedure there is a MsgBox which returns...
...but I get a run-time error 91
When I don't add the above (Sub wsNavigate) the variable returns MySelectedItem = "Item 11"
Any thoughts on how I am not calling the variable correctly to use a sheet navigation or is this the wrong use?
The variable MySelectedItem has the value "Item 11" and now can be used in other code.
...but I get a run-time error 91
Code:
Object variable or With block variable not set
Code:
Sub wsNavigate()
Sheets(MySelectedItem).Select
End Sub
When I don't add the above (Sub wsNavigate) the variable returns MySelectedItem = "Item 11"
Any thoughts on how I am not calling the variable correctly to use a sheet navigation or is this the wrong use?