Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub GetOrdersBtn_Click()
- Dim result As String, email As String, product As String, totalPrice As Double, lastRow As Integer, i As Integer
- email = EmailCB.Value
- lastRow = Sheet1.Cells(Rows.Count, 2).End(xlUp).row
- ResultTB.Clear
- For i = 2 To lastRow
- If Sheet1.Cells(i, "A").Value = email Then
- product = Sheet1.Cells(i, "B").Value
- totalPrice = Sheet1.Cells(i, "E").Value
- result = product & " - " & Format(totalPrice, "0.00")
- ResultTB.AddItem (result)
- End If
- Next
- End Sub
- Private Sub UserForm_Initialize()
- Dim lastRow As Integer, i As Integer
- lastRow = Sheet1.Cells(Rows.Count, 1).End(xlUp).row
- For i = 2 To lastRow
- If EmailCB.MatchFound = False Then
- EmailCB.AddItem (Sheet1.Cells(i, "A"))
- End If
- Next
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement