View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default can we copy the sheetnames too?

See one reply at your other thread.

Martyn wrote:

Hi,
This is one of the mistakes not "many" people can do....8-)))
I was so tired list night that I forgot to paste it completely. Sorry Frank.
Here goes
=============================
Private Sub Workbook_Open()
' Can we add Application.DisplayAlerts = False here?
Set shOrig = ActiveSheet
For Each sh In ActiveWorkbook.Worksheets
sh.Copy
ActiveWorkbook.SaveAs Filename:="C:\" & sh.Name & ".xls"
ActiveWorkbook.Close
Next sh
shOrig.Activate
End Sub
=============================
Martyn

"Frank Kabel" wrote in message
...
Hi
no code :-)

--
Regards
Frank Kabel
Frankfurt, Germany


Martyn wrote:
Hi,
The below code copies the content of our workbook sheets seperately
as new workbooks, but saves the sheets with default "Sheet1",
"Sheet2" name format. Can we also copy the used sheet names while
copying?
TIA


--

Dave Peterson