Basically, I have a column worth of names that I need to go through and use to create a new workbook, with each worksheet name being from the column. I am having trouble with the copy over. Here is my code:
Sub copySheet()
Dim oldBook As String
Dim newBook As String
Dim myRange As Range
Set myRange = Sheets("TOC").Range("O5:O381")
oldBook = ActiveWorkbook.name
For Each Cell In myRange
If Not Cell = "" Then
a = a + 1
ReDim Preserve myArray(1 To a)
myArray(a) = Cell
End If
Next
For a = 1 To 2
If a = 1 Then
myArray(a).Copy
newBook = ActiveWorkbook.name
Workbooks(oldBook).Activate
Else
myArray(a).Copy After:=Workbooks(newBook).Sheets(a - 1)
End Sub