Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I move multiple tabs in multiple workbooks to a master? | Excel Worksheet Functions | |||
Updating Workbooks from multiple links Workbooks | Excel Worksheet Functions | |||
Combine multiple workbooks into 1 workbook w/ multiple worksheets | Excel Discussion (Misc queries) | |||
Combine multiple workbooks into 1 workbook w/ multiple worksheets | Excel Discussion (Misc queries) | |||
adding certain cells in multiple worksheets in multiple workbooks | Excel Worksheet Functions |