SeanDamnit
Board Regular
- Joined
- Mar 13, 2011
- Messages
- 151
Hello Internet,
I have a dynamically sized array that I get from a SQL Query RecordSet. One of the fields contains a pipe delimited string that I'd like to parse out and add to the array.
Lets say my data looks like this:
I want it to look like this:
Problem is that I'm reading ReDim Preserve only works on the last dimension in the array. So....
Any advise? Is this even the best way to go about this?
Thanks!
I have a dynamically sized array that I get from a SQL Query RecordSet. One of the fields contains a pipe delimited string that I'd like to parse out and add to the array.
Lets say my data looks like this:
Code:
StoreList(0,0) = "District"
StoreList(0,1) = "NCAL2"
SotreList(0,3) = "ALB01"
StoreList(1,0) = "Location"
StoreList(1,1) = "17th & Mission"
StoreList(1,2) = "Crossgates Mall"
StoreList(2,0) = "Comments"
StoreList(2,1) = "FACTID | 11111 | AgentCode | ABCDE | ArmsID | 555"
StoreList(2,2) = "FACTID | 22222 | AgentCode | FGHIJ | ArmsID | 666"
I want it to look like this:
Code:
StoreList(0,0) = "District"
StoreList(0,1) = "NCAL2"
StoreList(0,2) = "ALB01"
StoreList(1,0) = "Location"
StoreList(1,1) = "17th & Mission"
StoreList(1,2) = "Crossgates Mall"
StoreList(2,0) = "Comments"
StoreList(2,1) = "FACTID | 11111 | AgentCode | ABCDE | ArmsID | 555"
StoreList(2,2) = "FACTID | 22222 | AgentCode | FGHIJ | ArmsID | 666"
StoreList(3,0) = "FACTID"
StoreList(3,1) = "11111"
StoreList(3,2) = "22222"
StoreList(4,0) = "AgentCode"
StoreList(4,1) = "ABCDE"
StoreList(4,2) = "FGHIJ"
StoreList(5,0) = "ArmsID"
StoreList(5,1) = "555"
StoreList(5,2) = "666"
Problem is that I'm reading ReDim Preserve only works on the last dimension in the array. So....
Code:
vCol = UBound(StoreList,1)
vRow = UBound(StoreList,2)
Redim Preserve StoreList(vCol + 3, vRow) ' This doesn't work
ReDim Preserve StoreList(vCol, vRow + 3) ' This does work, but obviously doesn't make sense with the way this array is setup.
Any advise? Is this even the best way to go about this?
Thanks!