PeterBaileyUk
asked on
remove array element in access vba
I wish to remove an element from the array that contains " " or "" I know it will involve a redim maybe a preserve too but not sure how to remove at the right place
so far:
For index = LBound(AliasArray) To UBound(AliasArray)
If AliasArray(index) = " " Or AliasArray(index) = "" Then remove that element
Next index
so far:
For index = LBound(AliasArray) To UBound(AliasArray)
If AliasArray(index) = " " Or AliasArray(index) = "" Then remove that element
Next index
ASKER
that looks great could you teach me about this part :
arr = Array(1, 2, 3, " ", 4)
i can see its making arr equal to array but the bits within the brackets i am not sure about
arr = Array(1, 2, 3, " ", 4)
i can see its making arr equal to array but the bits within the brackets i am not sure about
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
How are you creating the array in the first place?
If it's through code using Redim etc then perhaps you could add something to the code that creates the array to exclude the values/strings/whatever you don't want in the array.
If it's through code using Redim etc then perhaps you could add something to the code that creates the array to exclude the values/strings/whatever you don't want in the array.
ASKER
brilliant had to ask or i wont learn
Open in new window