Hi all,
I use the follow code to open Userform 2 when "x" is put in column 5 or 6.
The labels on this form are filled with data from the same worksheet (Data Gel).
Now i added a button on userform2 that opens the userform GelBMRproperties. I would like to pass the data that is in lblGelCodeR to the label lblGelCodeR that is also on the userformGelBMRproperties.
I tried something with commonvariable but it doesn't work.
Can someone help me?
I use the follow code to open Userform 2 when "x" is put in column 5 or 6.
The labels on this form are filled with data from the same worksheet (Data Gel).
Code:
If Target.Column = 5 Or Target.Column = 6 Then If Target.Value = "x" Then
With UserForm2
.lblGelCodeR.Caption = Cells(Target.Row, "A")
.lblBatchNumberR.Caption = Cells(Target.Row, "B")
.lblBoxR.Caption = Cells(Target.Row, "C")
.lblProductNameR.Caption = Application.VLookup(Cells(Target.Row, "A"), Sheets("Products").Range("A:B"), 2, 0)
.Show
End With
End If
End If
End Sub
Now i added a button on userform2 that opens the userform GelBMRproperties. I would like to pass the data that is in lblGelCodeR to the label lblGelCodeR that is also on the userformGelBMRproperties.
I tried something with commonvariable but it doesn't work.
Code:
Private Sub cmdInfo_Click()
Public commonVariable As String
commonVariable = lblGelCodeR.Caption
GelBMRProperties.Show
End Sub
Can someone help me?
Last edited: