C
choi4u
I'd like to declare a workbook and a worksheet before the first
procedure so that all other procedures can use them.
When I tryied to use Set Statement as "Set myBook =
Workbooks("test.xls")", I've got "invalid outside of a procedure"
error.
So, I guessed the Set statement may not work outside of a procedure
(I'm not sure). And then, I declared a string constant as "Public
Const myBook as "test.xls"" and used myBook in other procedure as
"Workbooks(myBook)", which worked fine.
However, I'd like to use something like myBook.mySheet.myRange.---,
insted of
Workbooks("myBook").Worksheets("mySheet").Range("myRange").---,
Any recommendation?
Thanks in advance.
procedure so that all other procedures can use them.
When I tryied to use Set Statement as "Set myBook =
Workbooks("test.xls")", I've got "invalid outside of a procedure"
error.
So, I guessed the Set statement may not work outside of a procedure
(I'm not sure). And then, I declared a string constant as "Public
Const myBook as "test.xls"" and used myBook in other procedure as
"Workbooks(myBook)", which worked fine.
However, I'd like to use something like myBook.mySheet.myRange.---,
insted of
Workbooks("myBook").Worksheets("mySheet").Range("myRange").---,
Any recommendation?
Thanks in advance.