Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can someone please helpme.
I need to backup a sheet called "RP LOG" as a new workbook named "RPLOG". I have 3 essential requirements though. 1. new workbook and sheet must be protected 2. row one which contains buttons linked to macros bust not be copied 3. the vba code copied across must be deleted. my attempt below has 2 problems One is that eventhough i delete row 1 the entire new row one acts as if the buttons are still there (cursor turns to a hand and links to a macro which is not in the new workbook resulting in an error) My second problem is how do i delete the vba code on the new sheet. Sub Backup() Application.DisplayAlerts = False ActiveWindow.SelectedSheets.Copy ActiveWorkbook.SaveAs "C:\RPLOG" ActiveSheet.Unprotect "OLDPASSWORD" Application.EnableEvents = False Rows(1).Delete Cells.Select Selection.Locked = True ActiveSheet.Protect "NEWPASSWORD" Workbooks("RPLOG.XLS").Save Workbooks("RPLOG.XLS").Close End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy certain cells to a "backup" sheet using VB | Excel Programming | |||
Backup | Excel Discussion (Misc queries) | |||
backup | Excel Discussion (Misc queries) | |||
Backup | Excel Discussion (Misc queries) | |||
backup | Excel Programming |