[RESOLVED] How to use a SpinButton to scroll through spreadsheets?
Hi,
I did a code to find sheets with some word in its name (word typed in a textbox; "InStr" to compare, etc). So, I saved numbers of these sheets in a vector (Dim sheets_with_my_word() as Integer).
Now I need to export this vector to a new userform that contains a SpinButton (and labels) to alternate among worksheets with that word in the name.
How could I do this?
Re: How to use a SpinButton to scroll through spreadsheets?
try
Code:
set sht = sheets(sheets_with_my_word(spinbutton1.value))
Re: How to use a SpinButton to scroll through spreadsheets?
Thanks I tried and I agree that can be the solution, but
"sheets_with_my_word()" received values in a userform and the spinbutton is in another, is it possible to "export" a variable from one userform to another?
Re: How to use a SpinButton to scroll through spreadsheets?
declare a public variable at the top of a module, that way it will remain in scope even after the userform is unloaded
Re: How to use a SpinButton to scroll through spreadsheets?
Perfect. I declared in a module but I had forgotten to use "public".
Thanks.