m_in_spain
Board Regular
- Joined
- Sep 28, 2018
- Messages
- 72
- Office Version
- 365
- Platform
- Windows
I am trying to retrieve data from a table in the workbook called Charge002.
The below code seems to work OK but I was hoping not to retrun blank rows to the ListView2
Here is the table:
Any help would be appreciated. I dont mind it returning the blank rows, if I must, but can they be returned under the data filled rows?
Many thanks in advance
The below code seems to work OK but I was hoping not to retrun blank rows to the ListView2
Here is the table:
VBA Code:
For Each rngCell In Range("Charge002")
If rngCell.Column = Range("Charge002").Columns(1).Column Then
If Not IsEmpty(rngCell.Value) Then
Set itmX = UserForm1.ListView2.ListItems.Add(, , rngCell.Value)
With itmX
For h = 1 To Range("Charge002").Columns.Count - 1
.SubItems(h) = rngCell.Offset(0, h)
Next h
End With
End If
End If
Next rngCell
Any help would be appreciated. I dont mind it returning the blank rows, if I must, but can they be returned under the data filled rows?
Many thanks in advance