View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gixxer_J_97[_2_] Gixxer_J_97[_2_] is offline
external usenet poster
 
Posts: 206
Default using command button instead of edit function

something like this should work

Dim wkbk As Workbook, sh As Worksheet
' might not need the 'array' - i copied/edited code that i am using currently
Worksheets(Array("Sheet11")).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:\temp\newtimesheet.xls"
wkbk.Close

hth!

J

"john tempest" wrote:

i have compiled a workbook that includes four worksheets. the work book is a
timesheet.when i have entered eveything into the workbook i need to to
seperate sheet11(timesheet) and save it. i do this by Edid/Move or copy
sheet. on the dropdown menu i select new book and i check the box marked
create copy.this works fine and i am able to save the copied sheet.this seems
a long way round.could i do this with a command button and vba code
thakyou john tempest