I have a global array, prLst() that be can of variable length. It takes in numbers as strings "1" to Ubound(prLst). However, when the user enters "0", I want to delete that element from the list. I have the following code written to perform this:
count2 = 0
eachHdr = 1
totHead = UBound(prLst)
Do
If prLst(eachHdr) = "0" Then
prLst(eachHdr).Delete
count2 = count2 + 1
End If
keepTrack = totHead - count2
'MsgBox "prLst = " & prLst(eachHdr)
eachHdr = eachHdr + 1
Loop Until eachHdr > keepTrack
This does not work. How do I efficiently delete elements in the array prLst if the element is "0"?
NOTE: This is part of a larger program, for which the description of can be found here: Sorting Groups of Rows Excel VBA Macro
FILTER()to remove the zeros from an array.