Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
toggling between 2 workbooks
I'm copying data from one workbook to another. One of them will have a
static file name, example test.xls The other workbook, from which the macro is run, will have a variable name, as it is changed each day, and given a new name based on the date, example test 10-01-06.xls Question is... in my macro, after I open up the other workbook (text.xls), how can I switch control back to the original workbook? Here's what I have so far: 'Opens the workbook w/ the static name Workbooks.Open Filename:= Test.xls" ......more code...... 'Control back to the original workbook. Then activates a worksheet. 'Remember - This workbook's name will change each day, w/ the date as part of the new name. Worksheets("sheet").Activate Thanks, J.O. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
toggling between 2 workbooks
Create a workbook variable and set it to the activeworkbook before opening
the next. Dim wb As Workbook Set wb = ActiveWorkbook Workbooks.Open.... BlahBlahBlah wb.Activate -- Charles Chickering "A good example is twice the value of good advice." "excelnut1954" wrote: I'm copying data from one workbook to another. One of them will have a static file name, example test.xls The other workbook, from which the macro is run, will have a variable name, as it is changed each day, and given a new name based on the date, example test 10-01-06.xls Question is... in my macro, after I open up the other workbook (text.xls), how can I switch control back to the original workbook? Here's what I have so far: 'Opens the workbook w/ the static name Workbooks.Open Filename:= Test.xls" ......more code...... 'Control back to the original workbook. Then activates a worksheet. 'Remember - This workbook's name will change each day, w/ the date as part of the new name. Worksheets("sheet").Activate Thanks, J.O. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help with toggling display | Excel Discussion (Misc queries) | |||
toggling | Excel Worksheet Functions | |||
Toggling autofit | Excel Discussion (Misc queries) | |||
toggling a chart on and off | Excel Programming | |||
Toggling one column of AutoFiltering | Excel Programming |