I have two userforms. the first one works good. it was constructed with one UOM and length in mind for assemblies. I realized the need to make it flexible so I created another userform looking at QTY's on userform1 and giving the user the ability to add other UOM and lengths. i'm trying to get the data entered in the second userform to come over with the data from userform1 into the "DATA" spreadsheet.
code below. information from userform1 is getting put into the "DATA" sheet but the data from the comboboxes and textboxes on Userform2 are not coming over. is this possible? any help would be great.
USERFORM1 SAVE COMMAND
Dim iRow As Long
iRow = Sheets("Data").Range("A1048576").End(xlUp).row + 1
With ThisWorkbook.Sheets("DATA")
.Range("A" & iRow).value = iRow - 1
.Range("B" & iRow).value = ComboBox4.Text
.Range("C" & iRow).value = ComboBox20.Text 'UOM'
.Range("D" & iRow).value = TextBox2.Text 'Lenght'
.Range("E" & iRow).value = ComboBox6.Text
.Range("F" & iRow).value = ComboBox8.Text
.Range("G" & iRow).value = ComboBox11.Text
.Range("H" & iRow).value = ComboBox12.Text
.Range("i" & iRow).value = ComboBox19.Text
.Range("j" & iRow).value = ": " & Environ("USERNAME")
End With
USERFORM2 SAVE COMMAND
Private Sub cmbsave2_Click()
Dim iRow As Long
iRow = Sheets("Data").Range("A1048576").End(xlUp).row + 1
With ThisWorkbook.Sheets("DATA")
.Range("A" & iRow).value = iRow - 1
.Range("B" & iRow).value = UserForm1.ComboBox4.Text
Dim x As Long
For x = 31 To 50
If Me.Controls("COMBOBOX" & x).Text <> 0 And Me.Controls("TEXTBOX" & x) <> 0 Then 'only pull information that does not equal zero'
.Range("C" & iRow).value = Me.Controls("COMBOBOX" & x).Text 'multiple UOM's'
.Range("D" & iRow).value = Me.Controls("TEXTBOX" & x).Text 'multiple lenght's'
End If
Next x
.Range("E" & iRow).value = UserForm1.ComboBox6.Text
.Range("F" & iRow).value = UserForm1.ComboBox8.Text
.Range("G" & iRow).value = UserForm1.ComboBox11.Text
.Range("H" & iRow).value = UserForm1.ComboBox12.Text
.Range("i" & iRow).value = UserForm1.ComboBox19.Text
.Range("j" & iRow).value = ": " & Environ("USERNAME")
End With
code below. information from userform1 is getting put into the "DATA" sheet but the data from the comboboxes and textboxes on Userform2 are not coming over. is this possible? any help would be great.
USERFORM1 SAVE COMMAND
Dim iRow As Long
iRow = Sheets("Data").Range("A1048576").End(xlUp).row + 1
With ThisWorkbook.Sheets("DATA")
.Range("A" & iRow).value = iRow - 1
.Range("B" & iRow).value = ComboBox4.Text
.Range("C" & iRow).value = ComboBox20.Text 'UOM'
.Range("D" & iRow).value = TextBox2.Text 'Lenght'
.Range("E" & iRow).value = ComboBox6.Text
.Range("F" & iRow).value = ComboBox8.Text
.Range("G" & iRow).value = ComboBox11.Text
.Range("H" & iRow).value = ComboBox12.Text
.Range("i" & iRow).value = ComboBox19.Text
.Range("j" & iRow).value = ": " & Environ("USERNAME")
End With
USERFORM2 SAVE COMMAND
Private Sub cmbsave2_Click()
Dim iRow As Long
iRow = Sheets("Data").Range("A1048576").End(xlUp).row + 1
With ThisWorkbook.Sheets("DATA")
.Range("A" & iRow).value = iRow - 1
.Range("B" & iRow).value = UserForm1.ComboBox4.Text
Dim x As Long
For x = 31 To 50
If Me.Controls("COMBOBOX" & x).Text <> 0 And Me.Controls("TEXTBOX" & x) <> 0 Then 'only pull information that does not equal zero'
.Range("C" & iRow).value = Me.Controls("COMBOBOX" & x).Text 'multiple UOM's'
.Range("D" & iRow).value = Me.Controls("TEXTBOX" & x).Text 'multiple lenght's'
End If
Next x
.Range("E" & iRow).value = UserForm1.ComboBox6.Text
.Range("F" & iRow).value = UserForm1.ComboBox8.Text
.Range("G" & iRow).value = UserForm1.ComboBox11.Text
.Range("H" & iRow).value = UserForm1.ComboBox12.Text
.Range("i" & iRow).value = UserForm1.ComboBox19.Text
.Range("j" & iRow).value = ": " & Environ("USERNAME")
End With