Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Multiple workbooks

Hello,

I a particular macro I skip several times between two workbooks. As the
name of the mother sheet differs often I would like to replace the name
that I use in the statement to a fixed code so that I do not have to
change the name in the macro each time that I would like to run it. Can
I set some sort of a parameter?

Thanks a lot for your help!!!

Rgds,
Robert

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Multiple workbooks

Hi Robert,

Probably you can work with the workbook as an object. Either it is
thisworkbook, or you have to open (create) it, so you can set an object
variable:

dim wb as workbook
set wb=workbooks.open filename:="somebook"
wb.activate

Regards,
Ivan

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Multiple workbooks

Hi Ivan,

Thanks for the info.

When I add your statement I get a compile error for 'filename'. As I am
not an expert on VBA I was wondering if you could write the statement
down when I want the current workbook to be set as 'wb'

Thanks again!

Rgds,
Robert

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Multiple workbooks

Hi Robert,

if you mean active workbook:

dim wb as workbook
set wb=activeworkbook
wb.save 'for example

if you mean workbook that contains the code, it is much simpler:

thisworkbook.activate 'for example

Regards,
Ivan

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
How do I move multiple tabs in multiple workbooks to a master? teelee Excel Worksheet Functions 3 October 15th 09 05:03 PM
Updating Workbooks from multiple links Workbooks TimJames Excel Worksheet Functions 1 December 15th 07 03:34 PM
Combine multiple workbooks into 1 workbook w/ multiple worksheets buffgirl71 Excel Discussion (Misc queries) 1 May 13th 06 12:28 PM
Combine multiple workbooks into 1 workbook w/ multiple worksheets buffgirl71 Excel Discussion (Misc queries) 2 May 12th 06 10:30 PM
adding certain cells in multiple worksheets in multiple workbooks Stephen via OfficeKB.com Excel Worksheet Functions 1 February 4th 05 08:31 PM


All times are GMT +1. The time now is 01:21 AM.

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

About Us

"It's about Microsoft Excel"