Hello,
I have a user form with a textbox. and I have a module I cant seem to get the value from the textbox in the userform and use it in another module, I have tried several different codes and cant seem to get it to work.
Here is my userform:
I am able to use msgbox to display the text to make sure my OpCheck variable is working.
And here is my module that I want to add the text to a cell:
I can use
and that works, but I am going to use a loop of some sort because I will have more textboxes in my userform that may or may not be used. Each checked, textbox will rerun the below module. So hopefully the OpText variable will display the correct text.
So any help well be greatly appreciated. And I thank you just for taking the time to read my posts.
I have a user form with a textbox. and I have a module I cant seem to get the value from the textbox in the userform and use it in another module, I have tried several different codes and cant seem to get it to work.
Here is my userform:
I am able to use msgbox to display the text to make sure my OpCheck variable is working.
Code:
Private Sub AddOpChecks_Click()
Call Blank
Call OperationalPassFail
Call Blank
If OperationChecks.CheckBox1.Value = True Then
OpText = OperationChecks.TextBox1.Text
MsgBox OpText
Call PassFailRow1
Call ChangeSwap
End If
If OperationChecks.CheckBox2.Value = True Then
OpText = OperationChecks.TextBox2.Text
MsgBox OpText
Call PassFailRow1
Call ChangeSwap
End If
End Sub
And here is my module that I want to add the text to a cell:
I can use
Code:
ColB.Value = OperationChecks.TextBox1.Text
Code:
Sub PassFailRow1()
Call lRows
Sheets("Sheet1").Range("B" & lRow & ":" & "N" & lRow).Clear
Call BCol
'AAA Column
ColA.Font.Color = White
ColA.Value = "1"
'B Column
Range(ColB, "E" & lRow).Merge
ColB.HorizontalAlignment = xlRight
'ColB.Value = OperationChecks.TextBox1.Text
MsgBox OpText
ColB.Value = OpText
'C Column
Call ChangeSwap
End Sub
So any help well be greatly appreciated. And I thank you just for taking the time to read my posts.