Hi,
I want to add data from multiple textboxes to a sheet that.
The form has multiple lines containing product data, like part, description, location, qty
It also has a textbox where you can enter the qty you need and txtQtyAdd
If the txtQtyAdd textbox contains a value it should copy the data from the textboxes with the same number to a sheet in excel.
So if txtQtyAdd1 and txtQtyAdd3 contains a value (number), the code should copy the data from the below textboxes to the sheet
txtPart1
txtDescrAv1
txtLocAv1
txtQtyAdd1
txtPart3
txtDescrAv3
txtLocAv3
txtQtyAdd3
This is the code I have but it only copies the data from the last filled in textboxes, in this example only the textboxes ending with 3.
Thanks for the help!
B.
I want to add data from multiple textboxes to a sheet that.
The form has multiple lines containing product data, like part, description, location, qty
It also has a textbox where you can enter the qty you need and txtQtyAdd
If the txtQtyAdd textbox contains a value it should copy the data from the textboxes with the same number to a sheet in excel.
So if txtQtyAdd1 and txtQtyAdd3 contains a value (number), the code should copy the data from the below textboxes to the sheet
txtPart1
txtDescrAv1
txtLocAv1
txtQtyAdd1
txtPart3
txtDescrAv3
txtLocAv3
txtQtyAdd3
This is the code I have but it only copies the data from the last filled in textboxes, in this example only the textboxes ending with 3.
Code:
For i = 1 To 10
If Controls("txtQtyAdd" & i).Value <> Empty Then
Sheets("PickList").Range("A" & LastRowA + 1) = Controls("txtPartAv" & i).Text
Sheets("PickList").Range("B" & LastRowA + 1) = Controls("txtDescrAv" & i).Text
Sheets("PickList").Range("C" & LastRowA + 1) = Controls("txtLocAv" & i).Text
Sheets("PickList").Range("D" & LastRowA + 1) = Controls("txtQtyAdd" & i).Text
End If
Next i
Thanks for the help!
B.