I'm trying to create a macro in excel that takes cell values from one tab and creates a reference to these values as worksheets in vba.
An example of a worksheet list would be the following (could be longer or shorter in length):
sheet1
sheet2
sheet3
...
I have been able to store this in an array using the code below. With this array I would like to take these stored values and use them to reference worksheets as could be done manually as in the following.
ws1= wb.Sheets("sheet1")
ws(i)= wb.Sheets("ws(i)")
Any help to solve this or recommending a different approach would be greatly appreciated!
Thanks, M
Dim wb As Workbook: Set wb = ThisWorkbook
Dim wsInputsList As Worksheet
Set wsInputsList = wb.Sheets("InputsTab")
Dim lastrowInputs As Long
lastrowInputs = wsInputsList.Cells(Rows.Count, 1).End(xlUp).Row
Dim i As Integer
i = 1
Do While i < lastrowInputs
Dim ws(1 To 50) As Variant
ws(i) = wsInputsList.Cells(i + 1, 1).Value
i = i + 1
Loop