G Geraldon Feb 9, 2004 #1 How would i add a variable which is defined in a workbook from to a label on a userform?
R Ron de Bruin Feb 9, 2004 #2 Hi Geraldon You can use this event that will run when you open the userform Private Sub UserForm_Initialize() Me.Label1.Caption = Sheets("Sheet1").Range("A1").Value End Sub
Hi Geraldon You can use this event that will run when you open the userform Private Sub UserForm_Initialize() Me.Label1.Caption = Sheets("Sheet1").Range("A1").Value End Sub
C Chip Pearson Feb 9, 2004 #3 I'm not exactly sure what you're asking, but you can assign a variable's contents to a label on a form with code like Userform1.Label1.Caption = VarName If you want to assign the value from a cell, use something like Userform1.Label1.Caption = Worksheets("Sheet1").Range("A1").Text -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com
I'm not exactly sure what you're asking, but you can assign a variable's contents to a label on a form with code like Userform1.Label1.Caption = VarName If you want to assign the value from a cell, use something like Userform1.Label1.Caption = Worksheets("Sheet1").Range("A1").Text -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com