I'm trying to create an array of values which I obtain from x many sheets that a data spreadsheet has.
Currently this is what I have so far
Sub Test()
Workbooks.Open("dataex.xlsx").Activate
Dim i, x, y, z, sheet_num
Dim allsheets As Variant
Dim sheet As Variant
Dim sheets As Variant '
Dim list As Variant
Dim ws As Worksheet
i = Application.sheets.Count
x = 1
ReDim allsheets(1 To i)
For Each ws In Worksheets
allsheets(x) = ws.Name
x = x + 1
Next ws
sheets = allsheets
For Each sheet In sheets
tmp = Range("A2").CurrentRegion.Value
y = Range("A1").CurrentRegion.Rows.Count
z = Range("A1").CurrentRegion.Columns.Count
list = Range(Cells(1, 1), Cells(y, z))
Next sheet
End Sub
I have attached a picture to show the the fake data I created (same data on each sheet for simplicity)
At the end I would like to get an array named list to be the same number of z columns but the rows of the values would be added underneath each other and then to resize the array and add the sheet it is from.
