Darren Smith
Well-known Member
- Joined
- Nov 23, 2020
- Messages
- 631
- Office Version
- 2019
- Platform
- Windows
Afternoon all
Much value any help on this
This code below shows only 1 value returned there are 24 plus values it should return??
Much value any help on this
This code below shows only 1 value returned there are 24 plus values it should return??
VBA Code:
Private Sub UserForm_Initialize()
Dim ws As Worksheet
Dim i As Long, Lastrow As Long, x As Long
With Me.WBase
Set ws = ThisWorkbook.Worksheets("Quote Detail")
Lastrow = ws.Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To ws.Range("A" & Lastrow).End(xlUp).Offset(1, 5).Row
x = Application.WorksheetFunction.CountIf(ws.Range("E" & 2, "E" & i), _
ws.Cells(i, 5).Cells.SpecialCells(xlCellTypeVisible).Value)
If x = 1 Then
Me.WBase.AddItem ws.Cells(2, 5).Value
End If
Next i
End with
End sub