View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
john tempest[_2_] john tempest[_2_] is offline
external usenet poster
 
Posts: 27
Default remove vba and functions when saving worksheet

this is the code i am using at the moment
Private Sub CommandButton1_Click()
Dim wkbk As Workbook, sh As Worksheet
Worksheets("TIMESHEET").Copy
Set wkbk = ActiveWorkbook
' get rid of all cell formulas
For Each sh In wkbk.Worksheets
With sh.UsedRange
.Value = .Value
End With
Next
wkbk.SaveAs "C:\Documents and Settings\Administrator\My
Documents\HOWDENS\TIMESHEET\ " & Sheets("TIMESHEET").Range("B5") & ".xls"
wkbk.Close
End Sub
this code removes the functions but the command button is stil functional
but does not do anything.when i save the worksheet i want the command button
to be non functional or if possible disappear altogether. am i asking too much
thankyou john tempest

"Bob Phillips" wrote:

In the save itself? If yes, see http://www.cpearson.com/excel/vbe.htm on how
to delete a code module.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"john tempest" wrote in message
...
can i remove vba and functions when saving a worksheet
thankyou john tempest