abdo meghari
Well-known Member
- Joined
- Aug 3, 2021
- Messages
- 573
- Office Version
- 2019
Hello
I'm not sure where is the mistake should be fixing. the code works except one thing . should start from row2 when copy data from userform .
but now start from row3
any help guys,please?
I'm not sure where is the mistake should be fixing. the code works except one thing . should start from row2 when copy data from userform .
but now start from row3
VBA Code:
Private Sub CommandButton4_Click()
Dim i As Long
With Sheets("PURCHASE")
.Range("e5").MergeArea = Me.TextBox1.Value
.Range("e8").MergeArea = Me.TextBox2.Value
For i = 1 To 11
.Cells(i + 1, 1).Value = Me.Controls("TextBox" & i)
Next i
For i = 12 To 44
.Cells(((i - 11) Mod 11) + 1, Int((i - 11) / 11) + 6).Value = Me.Controls("Textbox" & i)
Next i
For i = 2 To 45
.Cells(((i - 1) Mod 11) + 1, Int((i - 1) / 11) + 2).Value = Me.Controls("ComboBox" & i)
Next i
End With
TextBox34.Value = Me.TextBox12.Value * Me.TextBox23.Value
TextBox35.Value = Me.TextBox13.Value * Me.TextBox24.Value
TextBox36.Value = Me.TextBox14.Value * Me.TextBox25.Value
End Sub