|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
hi all
am having complete nightmare.... subscript out of range ReDim arrEmailAdd(lRowCountRef - 1, lRowCountRef - 1) ' declares the array variable with the necessary size Range("E2").Select Dim zz As Variant z = LBound(arrEmailAdd) x = LBound(arrEmailAdd) z = 2 x = 2 For zz = LBound(arrEmailAdd) To UBound(arrEmailAdd) arrEmailAdd(z) = ActiveCell.Value arrEmailAdd(x) = ActiveCell.Offset(0, -3).Value ActiveCell.Offset(1, 0).Select z = z + 1 x = x + 1 Next i have tried a million different ways and ALWAYS get the same error!!! |
|
#2
|
||||
|
||||
|
that's because you made the array 2-D array, with two dimensions,
but you try to use it as one dimension array. I could not really decipher the logic you're using there in the loop, but instead of those lines: Code:
rrEmailAdd(z) = ActiveCell.Value arrEmailAdd(x) = ActiveCell.Offset(0, -3).Value you can have such line for example: Code:
arrEmailAdd(z, x) = ActiveCell.Value arrEmailAdd(x, z) = ActiveCell.Offset(0, -3).Value or use two "normal" arrays instead of one 2D array. what exactly are you trying to do here? |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Argh! Multi Dim Array |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|