Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Help with ThisWorkbook

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ThisWorkbook vs. ActiveWorkbook? JK Excel Programming 5 April 19th 05 07:54 AM
ThisWorkbook Ron[_28_] Excel Programming 9 January 3rd 05 10:51 PM
commandbuttn ? in 'ThisWorkBook' mlm Excel Programming 1 February 18th 04 06:18 PM
ThisWorkbook.Path Birdy Excel Programming 1 February 10th 04 02:50 AM
ThisWorkbook variables... Jim Carlock[_2_] Excel Programming 13 September 1st 03 03:09 AM


All times are GMT +1. The time now is 10:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"