G
Guest
I would like to add the capability to the sub below of getting the name of
each worksheet within the open workbooks. I tried nesting a For Each
wsNames(j) within the For Each wb in Application.Workbooks loop. I was not
able to resolve the errors.
Your suggestions are appreciated.
Sub wbsOpen()
' Get the names of all open workbooks and store in an array
Dim wbNames(), wsNames() As String
Dim i, j As Integer, wb As Workbook, ws as Worksheet
ReDim wbNames(1 To Workbooks.Count)
i = 1
For Each wb In Application.Workbooks
wbNames(i) = wb.FullName
Debug.Print wbNames(i)
i = i + 1
Next
End Sub
each worksheet within the open workbooks. I tried nesting a For Each
wsNames(j) within the For Each wb in Application.Workbooks loop. I was not
able to resolve the errors.
Your suggestions are appreciated.
Sub wbsOpen()
' Get the names of all open workbooks and store in an array
Dim wbNames(), wsNames() As String
Dim i, j As Integer, wb As Workbook, ws as Worksheet
ReDim wbNames(1 To Workbooks.Count)
i = 1
For Each wb In Application.Workbooks
wbNames(i) = wb.FullName
Debug.Print wbNames(i)
i = i + 1
Next
End Sub