How to Loop Through All Open Workbooks in Excel VBA (Macro) - Code Included

preview_player
Показать описание
Grab the Free VBA Quick Reference Guide
In this video we will Loop through all the open workbooks. We will do this using the for each next loop and will loop through ever workbook within the workbooks object.

Code:
==============
Sub WBLoop()

Dim w As Workbook

For Each w In Workbooks
w.Activate
Debug.Print w.Name
Next
End Sub
Рекомендации по теме
Комментарии
Автор

dot activate.... Much love! I'm on the fringe of understanding VBA and it's become part of my job. That one line made the loop I'd Frankenstein'd actually work. None of the loops I found had that line. No idea how any of them worked but THANK YOU!!!!

Marajaid
Автор

not copied any data from any of the sheets

ramanjeet
Автор

I am unable to get the open workbook in loop . open from the internet explore .

ddesignerfashion
visit shbcf.ru