epardo87
Board Regular
- Joined
- Feb 24, 2015
- Messages
- 56
hi,
I have the code below, it transfers data into one excel row, I want to add another textbox (let's say RowsTextBox) so that all information is transferred as currently but copied in the following rows according to the qty at RowsTextBox.
Any suggestions?
I have the code below, it transfers data into one excel row, I want to add another textbox (let's say RowsTextBox) so that all information is transferred as currently but copied in the following rows according to the qty at RowsTextBox.
Any suggestions?
Code:
Private Sub RegCommandButton_Click()
Dim emptyRow As Long
Sheet2.Activate
emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1
Dim bControlEmpty As Boolean
bControlEmpty = False
If Len(ItemComboBox.Value) > 0 And Len(QtyTextBox.Value) > 0 And Len(AreaComboBox.Value) > 0 And Len(CauseComboBox.Value) > 0 Then
Cells(emptyRow, 3).Value = ItemComboBox.Value
Cells(emptyRow, 4).Value = QtyTextBox.Value
Cells(emptyRow, 5).Value = AreaComboBox.Value
Cells(emptyRow, 6).Value = CauseComboBox.Value
Else
bControlEmpty = True
End If
If bControlEmpty Then
MsgBox "Complete form please"
Else
ThisWorkbook.Save
Unload Me
End If
End Sub