VBA Macro to store All Opened Workbooks Names in an Array
Suppose we have 4 workbooks opened as follows :
Now you can store the Names of all these workbooks opened , using the below Macro :
Sub Opened_WB_Names()
Dim WB_Names() As String
WB_Count = Workbooks().Count
For X = 1 To WB_Count
ReDim Preserve WB_Names(X - 1)
WB_Names(X - 1) = Workbooks(X).Name
'MsgBox WB_Names(X - 1)
Next X
End Sub
Thanks,TAMATAM
Suppose we have 4 workbooks opened as follows :
Now you can store the Names of all these workbooks opened , using the below Macro :
Sub Opened_WB_Names()
Dim WB_Names() As String
WB_Count = Workbooks().Count
For X = 1 To WB_Count
ReDim Preserve WB_Names(X - 1)
WB_Names(X - 1) = Workbooks(X).Name
'MsgBox WB_Names(X - 1)
Next X
End Sub
Thanks,TAMATAM
No comments:
Post a Comment
Hi User, Thank You for visiting My Blog. Please post your genuine Feedback or comments only related to this Blog Posts. Please do not post any Spam comments or Advertising kind of comments which will be Ignored.