ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   seting a workbook to a varible name (https://www.excelbanter.com/excel-programming/296712-seting-workbook-varible-name.html)

steve

seting a workbook to a varible name
 
i forgot how do i set a workbook to a varible name
without using a for each, im sure im just forgeting
something small but cant rember...

pls help me


pikus

seting a workbook to a varible name
 
Dim WBVar As WorkBook

Set WBVar = Workbooks("Book1.xls")

Is that what you mean? - Piku

--
Message posted from http://www.ExcelForum.com


steve

seting a workbook to a varible name
 
lol

knew i was missing some thing simple
had the var name and the activeworkbook switched

lol

-----Original Message-----
Dim MyBook as WorkBook
Set MyBook=ActiveWorkBook
OR
Set MyBook = WorkBooks("TheWrkBkName")
.



All times are GMT +1. The time now is 05:25 PM.

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