Hello i experiance some struggeling with this point.
The main point is transfer data from 1 variable outside the userform, inside the userform.
This is what i currently have wich wasn't so succesfull:
Public M As String
Public WS As String
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
....Other Code.....
M = Month_S(C)
WS = ActiveSheet.Name
UserForm1.Show
End Sub
Userform:
Private Sub UserForm_Initialize()
MsgBox M
MsgBox WS
..... Other code ......
End sub
In the first code is the code outside the userform. the values there are putten in M and WS correctly, but when the userform is opened it does not excist within the userform.
Is there another way by declaring the variables outside the userform and still be able to use them inside the "Private Sub UserForm_Initialize()"?
Bookmarks