I posted my problem as an excample.
I want to set a worksheet variable in a userform and want to be able to use it in a module.
Userform
Macro Test1![]()
Public WS As Worksheet Private Sub TestButton_Click() Application.Run "Test1" End Sub Private Sub UserForm_initialize() Set WS = Blad7 End Sub
![]()
Sub Test1() WS.Cells(1, 1) = "TEST" End Sub
When you set a variable in a module you can use it for an userform but not visa versa.
Any one know how to fix this without setting the the WS again in de module?
Bookmarks