Tuesday, 2 June 2015

How to store All Opened Workbooks Names in an Array

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

Best Regards,
TAMATAM

No comments:

Post a Comment

Follow Me by Email

ExcelKingdom-Popular Posts

ExcelKingdom-Random Posts