lezawang
Well-known Member
- Joined
- Mar 27, 2016
- Messages
- 1,805
- Office Version
- 2016
- Platform
- Windows
Hi
The code below is to print each workbook's name. If I have 5 then it will msgbox these 5 files names. I want to improve this code so it can print all the name in one shot (not 5 msgboxs or whatever the number of the files). Is that possible? Thank you so much.
The code below is to print each workbook's name. If I have 5 then it will msgbox these 5 files names. I want to improve this code so it can print all the name in one shot (not 5 msgboxs or whatever the number of the files). Is that possible? Thank you so much.
Code:
Sub wb_names()
'to find workbook name
Dim x As Integer
Dim y As Integer
x = Workbooks.Count
For y = 1 To x
MsgBox Workbooks(y).Name
Next y
End Sub