Hello
I try copying data from userform to sheet INV_PUR . so when select combobox "CODE" will fill the others comboboxes and fill the item by serial number and write the values manually in textbox(QTY), textbox(PRICE) will calculation in textbox TOTAL and when move to next row on user form to select another item by select combobox (CODE) will do the same thing , after filling on userform should copy to sheet INV_PUR from row 19 . my problem ignores the numbers in textbox (ITEM) on userform ,should copy to column B in sheet INV_PUR from row 19 instead of that , will copy starting combobox(CODE) and clear words TOTAL,SUBTOTAL ,TAX when try copy data to sheet .
so I put the expected result after filling data on userform in last sheet how should be .
Private Sub CommandButton5_Click()
With Sheets("INV_PUR")
For i = 1 To 11
.Cells(i + 18, 2).Value = Me.Controls("TextBox" & i)
Next i
For i = 12 To 44
.Range("F19").Offset((i - 12) Mod 11, Int((i - 12) / 11)).Value = Me.Controls("Textbox" & i)
Next i
For i = 2 To 45
''
.Range("B19").Offset((i - 2) Mod 11, Int((i - 2) / 11)).Value = Me.Controls("ComboBox" & i)
Next i
End With
End Sub