Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default can we copy the sheetnames too?

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default can we copy the sheetnames too?

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default can we copy the sheetnames too?

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



  #4   Report Post  
Posted to microsoft.public.excel.programming
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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default can we copy the sheetnames too?

Hi
Dave provided already a solution for this in your other thread

--
Regards
Frank Kabel
Frankfurt, Germany

"Martyn" schrieb im Newsbeitrag
...
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






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default can we copy the sheetnames too?

Sorry Frank & Dave,
I guess you are right. I think there was a problem with the test
file I was working on. Now I've used the macro on another file and it works
OK!.
Martyn

"Frank Kabel" wrote in message
...
Hi
Dave provided already a solution for this in your other thread

--
Regards
Frank Kabel
Frankfurt, Germany

"Martyn" schrieb im Newsbeitrag
...
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






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sort Sheetnames when names are Months curiosity_killed_the_cat[_2_] Excel Discussion (Misc queries) 10 November 6th 07 12:07 PM
Copy and paste versus copy and insert copied cells Alana New Users to Excel 1 September 28th 07 08:58 PM
Allow relative referencing for imbedded sheetnames in formulas Ted Excel Worksheet Functions 1 March 8th 06 10:10 PM
Copy/Paste how to avoid the copy of formula cells w/o calc values Dennis Excel Discussion (Misc queries) 10 March 2nd 06 10:47 PM
EXCEL FILE a copy/a copy/a copy ....filename ve New Users to Excel 1 September 29th 05 09:12 PM


All times are GMT +1. The time now is 01:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"