pawelch
02-14-2011, 04:30 AM
Dear all
I have been struggling to find an answer to my problem regarding range in vba...
What I want is the following:
Dim aNames() As String
Dim aAddresses() As Range
...
...
Do While iIndex < iCounter
aNames(iIndex) = ActiveCell.Address
Set aAddresses(iIndex) = Range(aNames(iIndex))
iIndex = iIndex + 1
ActiveCell.Offset(0, 1).Select
Loop
In other words I am trying to get all addresses of cells within a given range of a row. The problem I come across is how can I use my stored data, because the following does not work:
" & Range(aAddresses(1).Address).Value & "Thank you in advance for any help and suggestion!
I have been struggling to find an answer to my problem regarding range in vba...
What I want is the following:
Dim aNames() As String
Dim aAddresses() As Range
...
...
Do While iIndex < iCounter
aNames(iIndex) = ActiveCell.Address
Set aAddresses(iIndex) = Range(aNames(iIndex))
iIndex = iIndex + 1
ActiveCell.Offset(0, 1).Select
Loop
In other words I am trying to get all addresses of cells within a given range of a row. The problem I come across is how can I use my stored data, because the following does not work:
" & Range(aAddresses(1).Address).Value & "Thank you in advance for any help and suggestion!