the condition above i had extract InvLabel1 Textbox all data from invoicelist.Private Sub ShowAllInvoiceCheckBox_click()
On Error Resume Next
Dim i As Long
If ShowAllInvoiceCheckBox.Value = True Then
Me.InvLabel1 = Format(StrConv(Me.InvLabel1, vbLowerCase))
Me.ListView1.ListItems.Clear
For i = 3 To Sheet4.Range("a1000000").End(xlUp).Row
For x = 1 To Len(Sheet4.Cells(i, 5))
a = Me.InvLabel1.TextLength
If LCase(Mid(Sheet4.Cells(i, 5), x, a)) = Me.InvLabel1 And Me.InvLabel1 <> "" Then
Set Itm = Me.ListView1.ListItems.Add(Text:=Sheet4.Cells(i, "A")) 'sl
Itm.SubItems(1) = Sheet4.Cells(i, "B") 'inv no
Itm.SubItems(2) = Format(Sheet4.Cells(i, "C"), "dd-MM-yy") 'date
Itm.SubItems(3) = Sheet4.Cells(i, "E") 'billing
Itm.SubItems(4) = Sheet4.Cells(i, "X") 'term
Itm.SubItems(5) = Format(Sheet4.Cells(i, "W"), "####0.00") 'orig Amt
Itm.SubItems(6) = Format(Sheet4.Cells(i, "DN"), "####0.00") 'outstanding
Itm.SubItems(7) = Format(Sheet4.Cells(i, "DO"), "####0.00") 'Paid
If Sheet4.Cells(i, "DN").Value >= 0.01 Then
For n = 1 To 7
Itm.ForeColor = vbRed
Itm.ListSubItems.ForeColor = vbRed
Next x
Next i
Next n
but the problem is i need add a condition in the "if and then" after the first "if and then" condition run
1st condition listview will appear all the data from InvLabel1
If LCase(Mid(Sheet4.Cells(i, 5), x, a)) = Me.InvLabel1 And Me.InvLabel1 <> "" Then
2nd condition i need to sort out with color from condition 1 with code below
If Sheet4.Cells(i, "DN").Value >= 0.01 Then For n = 1 To 7
Itm.ForeColor = vbRed
Itm.ListSubItems.ForeColor = vbRed
Next x
how to place in the upper vba code? attempt many times but wasn't success