Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default loop through the workbook and paste every sheet it into newly createdworkbook with same sheet name

i have a workbook which contain many sheets . i have to loop through
the workbook and paste every sheet it into newly created workbook
with same sheet name... hope this is possible .
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default loop through the workbook and paste every sheet it into newly created workbook with same sheet name

If you are not adding to an existing workbook, you could just as easily do a
SaveAs on the source workbook to the Filename you want to use for the new
workbook. This would give you the new workbook with the sheets having the
same name and content.



"vicky" wrote in message
...
i have a workbook which contain many sheets . i have to loop through
the workbook and paste every sheet it into newly created workbook
with same sheet name... hope this is possible .



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default loop through the workbook and paste every sheet it into newly createdworkbook with same sheet name


The code below will create a workbook wiht 10 sheets named Joel1 to
Joel10

Sub NameSheets()

SheetName = "Joel"
NumberofSheets = 10


ShtCount = Sheets.Count

For i = 1 To NumberofSheets
If i ShtCount Then
Sheets.Add after:=Sheets(Sheets.Count)
End If

Sheets(i).Name = SheetName & i
Next i


End Sub


--
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=152357

Microsoft Office Help

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default loop through the workbook and paste every sheet it into newly created workbook with same sheet name

See also
http://www.rondebruin.nl/copy6.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"vicky" wrote in message ...
i have a workbook which contain many sheets . i have to loop through
the workbook and paste every sheet it into newly created workbook
with same sheet name... hope this is possible .

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
Use loop to filter, copy/paste to new sheet; run through entire li ryguy7272 Excel Programming 2 November 25th 08 03:27 PM
Loop thru sheets copy and then paste in other sheet LuisE Excel Programming 2 August 7th 08 07:28 PM
automatic copy and paste from sheet to sheet in a workbook ramseyjramseyj Excel Programming 6 December 11th 04 12:37 AM
Naming a newly added sheet Chip Pearson Excel Programming 0 August 20th 04 03:26 PM
Naming a newly added sheet Frank Kabel Excel Programming 0 August 20th 04 03:25 PM


All times are GMT +1. The time now is 09:17 AM.

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

About Us

"It's about Microsoft Excel"