When applying the code using the IF and else rule, it applies to the first condition only and ignores the second condition, labs is a label
Thank you
Dim ww As Double, z As Double, s As Double, n As Double, j As Long
On Error Resume Next
ww = Application.WorksheetFunction.VLookup(ComboBox5.Value, ThisWorkbook.Sheets("users").Range("y2:z1000"), 2, 0)
With ListBox1
For j = 0 To ListBox1.ListCount - 1
If .List(j, 8) <> "" Then z = z + ListBox1.List(j, 6) * ww
s = s + ListBox1.List(j, 6) * ww
n = n + ListBox1.List(j, 6)
If ComboBox5.Value <> Labs2.Caption Or ComboBox5.Value <> Labs3.Caption Or ComboBox5.Value <> Labs4.Caption _
Or ComboBox5.Value <> Labs5.Caption Then
t11.Value = s
Else
t11.Value = z
End If
tx3.Value = n
Frame61.Visible = False
Labs7.Caption = ComboBox5.Value
Next j
End With
On Error GoTo 0
Bookmarks