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: 13
Default Worksheet_Deactivate() problem with deleting data



Hi I need to delete formaulas when a sheet deactivates but the formulas
in
the next sheet thats acivated are deleted instead, is there a way to do
this? (the formaulas are copied in when the worksheets are activated)

Private Sub Worksheet_Deactivate()
ActiveSheet.Unprotect Password:="naWages"
Range("AG17:AH41").Select
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("AY17:CI42").Select
Selection.ClearContents
Range("A1").Select
ActiveSheet.Protect Password:="naWages"
End Sub

Regards
Neil




*** Sent via Developersdex http://www.developersdex.com ***
 
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
Deleting cell data without deleting formula Tom Hall Excel Discussion (Misc queries) 4 October 29th 06 04:07 PM
Worksheet_Deactivate() problem with deleting data Karoo News Excel Programming 3 September 19th 05 01:39 PM
Capturing the selected tab in a worksheet_deactivate macro jkitzy Excel Programming 1 December 24th 04 09:01 PM
Excel – Macro Problem – Inserting, Appending Data, Deleting Aussiexcel[_3_] Excel Programming 0 August 25th 04 07:48 AM
Row deleting script problem jessica Excel Programming 1 October 15th 03 11:55 AM


All times are GMT +1. The time now is 08:51 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"