Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I have a macro that copies data from the active sheet to a separate sheet. Although the MBC Data Backup.xlsb file will never change, the name of the active workbook where the macro resides "Iron Horse MBC Listing 0.3.0.xlsb" will change from time to time and causes this scrip to fail. How can I make this work without referencing the actual name of the active file? Sub Backup() ' Backup Macro Workbooks.Open Filename:="C:\NSD\Personal\MBC Data Backup.xlsb" Range("A9:N20000").Select Selection.ClearContents Range("A9").Select Windows("Iron Horse MBC Listing 0.3.0.xlsb").Activate Sheets("Data").Select Range("A9:N20000").Select Selection.Copy Windows("MBC Data Backup.xlsb").Activate Range("A9").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Range("A9").Select Application.CutCopyMode = False ActiveWorkbook.Save ActiveWindow.Close Range("A9").Select Sheets("Cover").Select End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro that opens a separate workbook to a specified worksheet whenthe active workbook is right mouse clicked | Excel Programming | |||
Call macro from active workbook | Excel Programming | |||
Run Macro on all WS in active workbook.. | Excel Programming | |||
Changing the active workbook | Excel Programming | |||
run a macro on an in-active workbook | Excel Programming |