LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default sheet backup

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
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
Copy certain cells to a "backup" sheet using VB Chris Excel Programming 3 May 10th 09 04:42 PM
Backup sedgy Excel Discussion (Misc queries) 5 February 6th 09 06:13 PM
backup gall Excel Discussion (Misc queries) 6 August 8th 06 07:22 PM
Backup Alek Excel Discussion (Misc queries) 1 January 8th 06 01:23 AM
backup libby Excel Programming 1 January 14th 04 06:57 AM


All times are GMT +1. The time now is 03:35 AM.

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

About Us

"It's about Microsoft Excel"