Hello Everyone,
I have some code where I open a new worksheet and make a list of all the worksheets in the open workbook. My goal is to then run through that list and open a new workbook for each worksheet. My code will open new workbooks with the name of each cell in the list as the worksheet name, but the worksheets are blank. I would like the original worksheet to be in the new workbook.
Here is my code:
[VBA]
Worksheets.Add().Name = "WorksheetList"
Columns(1).Insert
For i = 1 To Sheets.Count
Cells(i, 1) = Sheets(i).Name
Next i
Sheets("WorksheetList").Select
Dim sRange As Range, sCell As Range
Dim WorksheetList As String
Set sRange = Sheets("WorksheetList").Range("A1", Range("A100").End(xlUp))
For Each sCell In sRange
WorksheetList = sCell
Workbooks.Add
ActiveSheet.Name = sCell.Value
Next sCell
[/VBA]
If somebody could help me make it so that each cell that populates in the list is directly tied to the original worksheet it is referencing, that would be great!
Please let me know if you need more information.
Thanks!