View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default keeping original workbook open when saving

Steven,

Generally:

Copy the sheet or sheets to a new workbook, then do the processing, and use the SaveAs command, then
close the newly saved book. For example:

Sub MakeCopyEditAndSave()
ThisWorkbook.Sheets("Sheet1").Copy
'Do processing here - call macro or put code
ActiveWorkbook.SaveAs Filename:= _
"C:\Whatever\" & NameString & ".xls" _
, FileFormat:=xlNormal
ActiveWorkbook.Close
End Sub

But if you have a specific logic for the row deletion, you might be able to automate the whole
process.....

HTH,
Bernie
MS Excel MVP


"steven" wrote in message
...
hello,

i work on a master workbook where a macro deletes rows from a worksheet.
After deleteing the rows I want the resulting workbook to be saved with a
specific filename.

I am able to go this far but then the I want to be able to revert to the
master workbook (prior to the rows being deleted) and run another macro for
different rows to be deleted and save the new file with another filename. And
then revert again ect.

How can I acomplish this? Cause my macro results to the master workbook to
be closed with the active worbook beng the saved worbook.

Thank you,

Steven.