CDICKENS
Active Member
- Joined
- Mar 24, 2002
- Messages
- 498
I have the following macro that returns a number value that I want to enter into a textbox. I can not figure out how to get that information to the textBox.
Here is my macro and the different things I tried are commented out:
Private Sub CommandButton5_Click()
Dim Upsell1 As Range
'Select the cell to be upsell1
UserForm2.Hide
Workbooks("Inventory.xls").Activate
On Error Resume Next
Set Upsell1 = Application.InputBox("Please select the AWINVNUM you want to Upsell.", , , , , , , 8)
If Upsell1 Is Nothing Then Exit Sub 'User pressed Cancel
On Error GoTo 0
UserForm2.Show
''UpsellItem1Box.Value = "Upsell:" & Upsell1
''UpsellItem1Box.Text = "Upsell:" & Upsell1
Workbooks("USER UPLOAD SHEET TEST.xls").Worksheets("Test").Activate
Range("C5").Value = Upsell1
''UserForm2.Show
''Label29.Caption = "Upsell1: " & Upsell1
End Sub
I can successfully enter the variable in a cell but I can not get that value to the textbox.
Any help?
Thanks,
Chuck
Here is my macro and the different things I tried are commented out:
Private Sub CommandButton5_Click()
Dim Upsell1 As Range
'Select the cell to be upsell1
UserForm2.Hide
Workbooks("Inventory.xls").Activate
On Error Resume Next
Set Upsell1 = Application.InputBox("Please select the AWINVNUM you want to Upsell.", , , , , , , 8)
If Upsell1 Is Nothing Then Exit Sub 'User pressed Cancel
On Error GoTo 0
UserForm2.Show
''UpsellItem1Box.Value = "Upsell:" & Upsell1
''UpsellItem1Box.Text = "Upsell:" & Upsell1
Workbooks("USER UPLOAD SHEET TEST.xls").Worksheets("Test").Activate
Range("C5").Value = Upsell1
''UserForm2.Show
''Label29.Caption = "Upsell1: " & Upsell1
End Sub
I can successfully enter the variable in a cell but I can not get that value to the textbox.
Any help?
Thanks,
Chuck