PC Review


Reply
Thread Tools Rate Thread

delete some cell formulas and leave others using code

 
 
=?Utf-8?B?am9obiB0ZW1wZXN0?=
Guest
Posts: n/a
 
      23rd Feb 2006
i have the following code which removes al ceel formulas and saves the sheet.
i would like to leave some of the formulas active but not all
can anybody help
thankyou john tempest
Private Sub CommandButton1_Click()
Dim wkbk As Workbook, sh As Worksheet
Worksheets("MANUAL TS").Copy
Set wkbk = ActiveWorkbook
' get rid of all cell formulas
For Each sh In wkbk.Worksheets
With sh.UsedRange
.Value = .Value
'getrid of command button'
ActiveSheet.OLEObjects("CommandButton1").Delete
End With
Next
wkbk.SaveAs "C:\Documents and Settings\Administrator\My
Documents\HOWDENS\TIMESHEET\ " & Sheets("MANUAL TS").Range("B5") & ".xls"
wkbk.Close
End Sub
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
in xl..how to delete data and leave formulas Graywolf Microsoft Excel Crashes 1 9th Nov 2009 09:40 PM
Clear data but leave formulas Jeff Granger Microsoft Excel Discussion 2 2nd Jul 2007 11:00 AM
Excel should allow delete cell's value but leave formula alone. =?Utf-8?B?TXJRdWljaw==?= Microsoft Excel Misc 7 25th Jan 2006 10:28 PM
Delete cell contents while retaining formulas Dave A. Microsoft Excel Discussion 1 2nd Dec 2004 05:39 PM
Set cell formulas using code? how? Reedi Microsoft Excel Programming 1 5th Oct 2003 10:29 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:17 PM.