Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
ThisWorkbook will always refer to the active workbook. But you can use the
syntax Workbooks("WorkbookName") to refer to any open workbook. "WorkbookName" would be the title of the workbook as it appears in the Windows Title Bar; e.g. "Book1", or "MASTER", etc. "David" wrote: I am creating a Macro in a MASTER.xls file which contains default data. This master.xls file is then copied into a weekly file where daily financial information is entered and sent to me at the home office from many field locations. I am creating this macro in the master.xls file, which will be copied into the weekly file and then used to calculate bonus information, which will be written into a static second file that is kept at each business location. What I need is a way to have the macro run and use the data from each weekly file and it looks like the best way to do this is with the use of the "thisworkbook" convention. I am very new to macros and have successfully "recorded" the macro to run the way I want. But in the macro, I am referring to the specific worksheet name where the data is coming from. So I need help and maybe an example of how to CHANGE the VB macro language to use the "thisworkbook" function and replace the actual name of the workbook I've recorded. The line is currently Windows("bonus test2").Activate Thanks in advance for your help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
ThisWorkbook vs. ActiveWorkbook? | Excel Programming | |||
ThisWorkbook | Excel Programming | |||
commandbuttn ? in 'ThisWorkBook' | Excel Programming | |||
ThisWorkbook.Path | Excel Programming | |||
ThisWorkbook variables... | Excel Programming |