View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
ImpulseBlue ImpulseBlue is offline
external usenet poster
 
Posts: 19
Default how can i get a macro in personal.xls to know my current workbook?

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.