Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
how can i get a macro in personal.xls to know my current workbook?
Set ws1 = ThisWorkbook.Sheets(1)
Instead of ThisWorkbook, how can I get a macro I have stored in personal.xls to use the currently active workbook? It is currently referring only to personal.xls, which needless to say is hidden and unused. I cannot hard-code a workbook name because every day there is a new set of workbooks generated from a database, and the names are always different/dynamic. I need to be able to just open a newly generated workbook, run my macro, and exit excel as soon as the magic stops. Thanks a ton. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
how can i get a macro in personal.xls to know my current workbook?
|
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
how can i get a macro in personal.xls to know my current workbook?
Awesome, thanks!
I'm an excel noob, but I don't use it enough to need to learn VBA :) ImpulseBlue wrote: ActiveWorkbook.Sheets(1) wrote: Set ws1 = ThisWorkbook.Sheets(1) Instead of ThisWorkbook, how can I get a macro I have stored in personal.xls to use the currently active workbook? It is currently referring only to personal.xls, which needless to say is hidden and unused. I cannot hard-code a workbook name because every day there is a new set of workbooks generated from a database, and the names are always different/dynamic. I need to be able to just open a newly generated workbook, run my macro, and exit excel as soon as the magic stops. Thanks a ton. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Personal Macro Workbook | Excel Worksheet Functions | |||
No Personal Macro Workbook? | Excel Programming | |||
Personal macro workbook and personal.xls | Excel Discussion (Misc queries) | |||
Personal Macro Workbook | Excel Programming |