public variables, 2 userforms

  • Thread starter Thread starter Charlie
  • Start date Start date
C

Charlie

I set ws1 as sheet1 or sheet2 on Userform1.
I need to reference ws1 on Userform2, but it doesn't seem to recognize ws1.
How do I make ws1 public to all forms? I just have Public ws1 as Worksheet
before my code on Userform1
thanks.
 
This is just a guess, but try putting
Public ws1 as Worksheet
in a standard Code Module, instead of the form's code module.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top