ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Iterate though all open spreadsheets (https://www.excelbanter.com/excel-worksheet-functions/16962-iterate-though-all-open-spreadsheets.html)

J Shrimps, Jr.

Iterate though all open spreadsheets
 
Have used Walkenbach's book to create
a macro that itterates through all open worksheets
in an Excel workbook and places the name
of the workseet in a specific cell.
But I don't see the code to iterate through
ALL open spreadsheets.
I have to rename each open worksheet in a folder
(there's only one worksheet in each spreadsheet).
"Sheet1" for linking purposes.
The spreadsheets are results of an export
from Access, which by default names
Worksheet1 as the name of the query.
Not viable to name each query "Sheet1".



OJ

Hi,
Dim objWb As Workbook

For Each objWb In Application.Workbooks
.....your code here
Next objWb

Hth,
OJ



All times are GMT +1. The time now is 02:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com