ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   What is brest way to flit between two spreadsheets (https://www.excelbanter.com/excel-programming/282540-what-brest-way-flit-between-two-spreadsheets.html)

Angus Comber[_2_]

What is brest way to flit between two spreadsheets
 
Hello

I have a sheet1.xls and a sheet2.xls - they are both currently open.

If I want to refer to one spreadsheet file I can use
Excel.Workbooks(indexnumber) but can I do the same using a variable filename
string.

For example I want to do something like

A) Refer to sheet1.xls

Worksbooks.Attach strFirstSheet


B) Refer to sheet2.xls
Workbooks.Attach strSecondSheet

How can I do this?

Angus Comber





Angus Comber[_2_]

What is brest way to flit between two spreadsheets
 
Sorry for being a berk!

I can use Excel.Workbooks(strFile).activate or whatever

Angus

"Angus Comber" wrote in message
...
Hello

I have a sheet1.xls and a sheet2.xls - they are both currently open.

If I want to refer to one spreadsheet file I can use
Excel.Workbooks(indexnumber) but can I do the same using a variable

filename
string.

For example I want to do something like

A) Refer to sheet1.xls

Worksbooks.Attach strFirstSheet


B) Refer to sheet2.xls
Workbooks.Attach strSecondSheet

How can I do this?

Angus Comber








All times are GMT +1. The time now is 09:58 AM.

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