bikerboy718
Programmer
I am not sure if this is possible in VBA but can i Redim and array using the preserve keyword.
This is what i have so far.
Range("A1").Select
Selection.End(xlDown).Select
RowCount = ActiveCell.Row
Dim arrlen As Integer
arrlen = 0
Dim acctNumArr(0) As String
For i = 1 To RowCount
Range("H" & i).Select
rowH = ActiveCell.Value
For j = 0 To arrlen
If acctNumArr(j) = ActiveCell.Value Then
flag = True
Else
flag = False
End If
Next
If flag = False Then
arrlen = arrlen + 1
ReDim Preserve acctNumArr(arrlen)
acctNumArr(arrlen) = ActiveCell.Value
End If
Next
The problem that i run into is that i continue to get a Array alredy dimensioned error. Any help is greatly appreciated.
This is what i have so far.
Range("A1").Select
Selection.End(xlDown).Select
RowCount = ActiveCell.Row
Dim arrlen As Integer
arrlen = 0
Dim acctNumArr(0) As String
For i = 1 To RowCount
Range("H" & i).Select
rowH = ActiveCell.Value
For j = 0 To arrlen
If acctNumArr(j) = ActiveCell.Value Then
flag = True
Else
flag = False
End If
Next
If flag = False Then
arrlen = arrlen + 1
ReDim Preserve acctNumArr(arrlen)
acctNumArr(arrlen) = ActiveCell.Value
End If
Next
The problem that i run into is that i continue to get a Array alredy dimensioned error. Any help is greatly appreciated.