ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to "Set alias for worksheet in other excel file" (https://www.excelbanter.com/excel-programming/292354-how-set-alias-worksheet-other-excel-file.html)

davidc

How to "Set alias for worksheet in other excel file"
 
set ws1 = worksheet("sheet1")
this is used to set alias for the local worksheet
But how to set alias for worksheet located in other excel
file?

Frank Kabel

How to "Set alias for worksheet in other excel file"
 
Hi
one way:
...
Dim wbk as workbook
Dim wks as worksheet
set wbk = workbooks("other workbook.xls")
set wks = wbk.worksheets("sheet1")
....

--
Regards
Frank Kabel
Frankfurt, Germany

davidc wrote:
set ws1 = worksheet("sheet1")
this is used to set alias for the local worksheet
But how to set alias for worksheet located in other excel
file?



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

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