MINCUS1308
06-24-2014, 10:56 AM
' I HAVE TWO FORMS: Macro1 AND Macro2.
' BOTH HAVE A TEXTBOX NAMED: TextBox1 ON THEM.
' CAN I CALL A FUNCTION: RandomFunctions(VariableForm)
' AND TAKE THE DATA FROM A VARIABLE FORM'S (I.E. Macro1 OR Macro2)
' CORESPONDING TEXTBOX: TextBox1 AND PLACE IT
' INTO CELL A1 ON Sheet1?
Sub Macro1()
VariableForm = "Macro1"
Call RandomFunctions(VariableForm)
End Sub
Sub Macro2()
VariableForm = "Macro2"
Call RandomFunctions(VariableForm)
End Sub
Sub RandomFunctions(VariableForm)
Sheets("Sheet1").Range("A1").Value = VariableForm.TextBox1.Value
End Sub
' BOTH HAVE A TEXTBOX NAMED: TextBox1 ON THEM.
' CAN I CALL A FUNCTION: RandomFunctions(VariableForm)
' AND TAKE THE DATA FROM A VARIABLE FORM'S (I.E. Macro1 OR Macro2)
' CORESPONDING TEXTBOX: TextBox1 AND PLACE IT
' INTO CELL A1 ON Sheet1?
Sub Macro1()
VariableForm = "Macro1"
Call RandomFunctions(VariableForm)
End Sub
Sub Macro2()
VariableForm = "Macro2"
Call RandomFunctions(VariableForm)
End Sub
Sub RandomFunctions(VariableForm)
Sheets("Sheet1").Range("A1").Value = VariableForm.TextBox1.Value
End Sub