Hi All
I have the below code which populates a copy of a template sheet called Invoice. It works perfectly. Only problem I have is that the items captured are in random orders. What I want to achieve is to split the way it populates based on a textbox value. Invoice is currrent outcome and New Invoice is the result I want to achieve.
ws1.Select
With ws1
For v = 7 To 20
If ws1.Cells(v, 2) = Item Then
Cells(v, 1).Value = CInt(Cells(v, 1).Value) + CInt(UserForm1.TextBox2.Value)
Cells(v, 4) = Format(Cells(v, 1), "0.00") * Format(TextBox3, "0.00")
Cells(v, 4).NumberFormat = "#,###.00"
'TextBox1 = ""
'TextBox2 = ""
'TextBox3 = ""
'TextBox9 = ""
'TextBox11 = ""
GoTo next_sheet
End If
Next
End With
With ws1.Range("a4")
.End(xlDown).Offset(1).Resize(, 4) = Array(TextBox2, TextBox1, Format(TextBox3, "0.00"), Format(TextBox2, "0.00") * Format(TextBox3, "0.00"))
.End(xlDown).Offset(1).EntireRow.Insert shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
.End(xlDown).Offset(1, 2).NumberFormat = "0.00"
.End(xlDown).Offset(1, 3).NumberFormat = "0.00"
End With
Somewhere, i need to add a If statement that checks the following:
If UserForm.TextBox11 = "BP" Then
'Populate above beverages
ElseIf
UserForm.TextBox11 = "KP" Then
'Populate above food
End If
Bookmarks