RawlinsCross
Active Member
- Joined
- Sep 9, 2016
- Messages
- 437
In what I thought would be a fairly straight forward operation, I'm getting stumped with an error. I have a table on a worksheet that I have registered under a NamedRange. I simply want to push each row to a Variant variable in turn. Easy right? Clearly I'm missing something.
The array vTable is a mixture of data types, string, date, numbers.
VBA Code:
Private Sub RemoveDuplicateWORows()
Dim lFirst As Long, lLast As Long, i As Long
Dim vTable() As Variant
Dim vRow() As Variant
Dim wSht As Worksheet
Dim rRange As Range
Set wSht = ThisWorkbook.Worksheets("Data")
Set rRange = wSht.Range("rngData")
vTable = rRange.value
'Get first and last array positions
lFirst = LBound(vTable, 1)
lLast = UBound(vTable, 1)
For i = lFirst To lLast
vRow = WorksheetFunction.Index(vTable, i, 0) 'mismatch error here
Next i
End Sub
The array vTable is a mixture of data types, string, date, numbers.