redimension multidimensional arrays in Excel VBA [migrated]
- by user147178
Take a look at the following code. What my problem is is that I can't figure out how to redimension the n integer and the b integer. What I'm doing is the array sent1 is already working and it is populated with about 4 sentences. I need to go through each sentence and work on it but I'm having trouble.
dim sent1()
dim sent2()
dim n as integer, b as integer, x as integer
dim temp_sent as string
b = 0
For n = 1 to ubound(sent1)
temp_sent = sent1(n)
for x = 1 to len(temp_sent1)
code
if a then
b = b + 1
THIS IS THE PART OF THE CODE THAT IS NOT WORKING
redim preserve sent2(1 to ubound(sent1), b)
sent2(n,b) = [code]
next
next