drom
Well-known Member
- Joined
- Mar 20, 2005
- Messages
- 528
- Office Version
- 2021
- 2019
- 2016
- 2013
- 2011
- 2010
- 2007
hi and thanks in advance!
is it possible to do something like this:
My workbook may contain many sheets from 2 until 50 (every day the number of sheets is different)
I would like to create a dinamic number of arrays
But I do not know how can I do this.
Any idea ?
So my question :
Is it possible to create a dinamic array of arrays ?
I know I can solve my problem in my first macro with something like:
And yes for my specific query may work,
But My question is:
Is it possible to create a array of arrays?
is it possible to do something like this:
VBA Code:
Sub MrExcelQuestion()
On Error Resume Next
Dim SHT As Object
Dim X As Single
dim aSHT ??????
For Each SHT In ThisWorkbook.Sheets
X = X + 1
ReDim aSHT & X() : aSHT & X ()= SHT.Range("A1").UsedRange.Value
Next SHT
End Sub
My workbook may contain many sheets from 2 until 50 (every day the number of sheets is different)
I would like to create a dinamic number of arrays
But I do not know how can I do this.
- I guess maeby using class modules and/or...
Any idea ?
So my question :
Is it possible to create a dinamic array of arrays ?
I know I can solve my problem in my first macro with something like:
VBA Code:
Sub MrExcelQuestion()
On Error Resume Next
Dim SHT As Object
Dim aSHT()
Dim X As Single
Dim wSHT As String
Dim rUsedRange As Range
For Each SHT In ThisWorkbook.Sheets
X = X + 1: wSHT = SHT.Name
Set rUsedRange = Nothing: Set rUsedRange = Sheets(wSHT).Range("A1").UsedRange
ReDim Preserve aSHT(1 To X): aSHT (X) = SHT.Name & "---" & rUsedRange.Address)
Next SHT
End Sub
And yes for my specific query may work,
But My question is:
Is it possible to create a array of arrays?