Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Creating multiple worksheets...

I'm trying to figure out how to duplicate worksheet #1 and then create 54
additional worksheets without having to (copy #1 - create new worksheet -
Paste #1 onto new worksheet - repeat for each additional worksheet) Is this
possible? Using Excel 2007
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Creating multiple worksheets...

Kent

Stick this macro into a general module in your workbook.

Select the sheet to copy and run the macro.

Sub SheetCopy22()
Dim i As Long
On Error GoTo endit
Application.ScreenUpdating = False
shts = InputBox("How many times?")
For i = 1 To shts
ActiveSheet.Copy After:=ActiveSheet
With ActiveSheet
.Name = "NewSheet" & i
End With
Next i
Application.ScreenUpdating = True
endit:
End Sub

To do the above "sticking" hit Alt + F11 to open the Visual Basic Editor.

CTRL + r to open the Project Explorer.

Select your workbook/project and right-clickInsertModule.

Paste the macro into that module.

FileSave then Alt + q to return to Excel.

ToolsMacroMacros........select SheetCopy22 and "Run"

If you want names other than NewSheet1, 2 ,3 etc. post back for more help.


Gord Dibben MS Excel MVP

On Fri, 18 May 2007 19:13:00 -0700, Kent K
wrote:

I'm trying to figure out how to duplicate worksheet #1 and then create 54
additional worksheets without having to (copy #1 - create new worksheet -
Paste #1 onto new worksheet - repeat for each additional worksheet) Is this
possible? Using Excel 2007


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Creating multiple worksheets...

Sounds good. Will be my first time using a "macro." I intend on creating
TOC containing all 50 US states. I will be hyperlinking a given cell on TOC
to it's respective worksheet within the book. Each subsequent worksheet will
be Named accordingly.
ie. worksheet 2 = Alabama, ws3 = Alaska, etc.. I will be hyperlinking a
given cell on TOC to it's respective worksheet within the workbook.

Is there a macro which will allow me to name the consecutive worksheets all
at once?

Also, I'm trying to figure out if I can select the same cell in all sub
worksheets and "mass" hyperlink to the TOC. The first two worksheets are
named State Directory (SD) and Regional Directory (RD) respectively. From
ws3 onward, all page layouts are identical, allowing two cells, (A3 & A4) to
be used for hyperlinking to the two directories. I would like to be able to
type SD into A3, and RD into A4 and apply it to all worksheets as well as
being able to create a hyperlink to the directories intended. Is this
possible? Thanks for the help!!

"Gord Dibben" wrote:

Kent

Stick this macro into a general module in your workbook.

Select the sheet to copy and run the macro.

Sub SheetCopy22()
Dim i As Long
On Error GoTo endit
Application.ScreenUpdating = False
shts = InputBox("How many times?")
For i = 1 To shts
ActiveSheet.Copy After:=ActiveSheet
With ActiveSheet
.Name = "NewSheet" & i
End With
Next i
Application.ScreenUpdating = True
endit:
End Sub

To do the above "sticking" hit Alt + F11 to open the Visual Basic Editor.

CTRL + r to open the Project Explorer.

Select your workbook/project and right-clickInsertModule.

Paste the macro into that module.

FileSave then Alt + q to return to Excel.

ToolsMacroMacros........select SheetCopy22 and "Run"

If you want names other than NewSheet1, 2 ,3 etc. post back for more help.


Gord Dibben MS Excel MVP

On Fri, 18 May 2007 19:13:00 -0700, Kent K
wrote:

I'm trying to figure out how to duplicate worksheet #1 and then create 54
additional worksheets without having to (copy #1 - create new worksheet -
Paste #1 onto new worksheet - repeat for each additional worksheet) Is this
possible? Using Excel 2007



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Creating multiple worksheets...

sorry... one more question. Where do I start and end my "copy" of the macro
you provided?

"Gord Dibben" wrote:

Kent

Stick this macro into a general module in your workbook.

Select the sheet to copy and run the macro.

Sub SheetCopy22()
Dim i As Long
On Error GoTo endit
Application.ScreenUpdating = False
shts = InputBox("How many times?")
For i = 1 To shts
ActiveSheet.Copy After:=ActiveSheet
With ActiveSheet
.Name = "NewSheet" & i
End With
Next i
Application.ScreenUpdating = True
endit:
End Sub

To do the above "sticking" hit Alt + F11 to open the Visual Basic Editor.

CTRL + r to open the Project Explorer.

Select your workbook/project and right-clickInsertModule.

Paste the macro into that module.

FileSave then Alt + q to return to Excel.

ToolsMacroMacros........select SheetCopy22 and "Run"

If you want names other than NewSheet1, 2 ,3 etc. post back for more help.


Gord Dibben MS Excel MVP

On Fri, 18 May 2007 19:13:00 -0700, Kent K
wrote:

I'm trying to figure out how to duplicate worksheet #1 and then create 54
additional worksheets without having to (copy #1 - create new worksheet -
Paste #1 onto new worksheet - repeat for each additional worksheet) Is this
possible? Using Excel 2007



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Creating multiple worksheets...

Kent

This macro by Dave Peterson will copy a sheet named Template and name each sheet
according to a list of names you have on a List sheet.

It would replace the macro I gave you yesterday.

Sub CreateNameSheets()
' by Dave Peterson
' List sheetnames required in col A in a sheet: List
' Sub will copy sheets based on the sheet named as: Template
' and name the sheets accordingly

Dim TemplateWks As Worksheet
Dim ListWks As Worksheet
Dim ListRng As Range
Dim mycell As Range

Set TemplateWks = Worksheets("Template")
Set ListWks = Worksheets("list")
With ListWks
Set ListRng = .Range("a1", .Cells(.Rows.Count, "A").End(xlUp))
End With

For Each mycell In ListRng.Cells
TemplateWks.Copy After:=Worksheets(Worksheets.Count)
On Error Resume Next
ActiveSheet.Name = mycell.Value
If Err.Number < 0 Then
MsgBox "Please fix: " & ActiveSheet.Name
Err.Clear
End If
On Error GoTo 0
Next mycell

End Sub

Copy all from Sub CreateNamedSheets() down to End Sub

I will address the TOC in a follow-up post.

Gord

On Fri, 18 May 2007 22:27:00 -0700, Kent K
wrote:

Sounds good. Will be my first time using a "macro." I intend on creating
TOC containing all 50 US states. I will be hyperlinking a given cell on TOC
to it's respective worksheet within the book. Each subsequent worksheet will
be Named accordingly.
ie. worksheet 2 = Alabama, ws3 = Alaska, etc.. I will be hyperlinking a
given cell on TOC to it's respective worksheet within the workbook.

Is there a macro which will allow me to name the consecutive worksheets all
at once?

Also, I'm trying to figure out if I can select the same cell in all sub
worksheets and "mass" hyperlink to the TOC. The first two worksheets are
named State Directory (SD) and Regional Directory (RD) respectively. From
ws3 onward, all page layouts are identical, allowing two cells, (A3 & A4) to
be used for hyperlinking to the two directories. I would like to be able to
type SD into A3, and RD into A4 and apply it to all worksheets as well as
being able to create a hyperlink to the directories intended. Is this
possible? Thanks for the help!!

"Gord Dibben" wrote:

Kent

Stick this macro into a general module in your workbook.

Select the sheet to copy and run the macro.

Sub SheetCopy22()
Dim i As Long
On Error GoTo endit
Application.ScreenUpdating = False
shts = InputBox("How many times?")
For i = 1 To shts
ActiveSheet.Copy After:=ActiveSheet
With ActiveSheet
.Name = "NewSheet" & i
End With
Next i
Application.ScreenUpdating = True
endit:
End Sub

To do the above "sticking" hit Alt + F11 to open the Visual Basic Editor.

CTRL + r to open the Project Explorer.

Select your workbook/project and right-clickInsertModule.

Paste the macro into that module.

FileSave then Alt + q to return to Excel.

ToolsMacroMacros........select SheetCopy22 and "Run"

If you want names other than NewSheet1, 2 ,3 etc. post back for more help.


Gord Dibben MS Excel MVP

On Fri, 18 May 2007 19:13:00 -0700, Kent K
wrote:

I'm trying to figure out how to duplicate worksheet #1 and then create 54
additional worksheets without having to (copy #1 - create new worksheet -
Paste #1 onto new worksheet - repeat for each additional worksheet) Is this
possible? Using Excel 2007






  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Creating multiple worksheets...

See other post.

Gord

On Fri, 18 May 2007 22:39:00 -0700, Kent K
wrote:

sorry... one more question. Where do I start and end my "copy" of the macro
you provided?

"Gord Dibben" wrote:

Kent

Stick this macro into a general module in your workbook.

Select the sheet to copy and run the macro.

Sub SheetCopy22()
Dim i As Long
On Error GoTo endit
Application.ScreenUpdating = False
shts = InputBox("How many times?")
For i = 1 To shts
ActiveSheet.Copy After:=ActiveSheet
With ActiveSheet
.Name = "NewSheet" & i
End With
Next i
Application.ScreenUpdating = True
endit:
End Sub

To do the above "sticking" hit Alt + F11 to open the Visual Basic Editor.

CTRL + r to open the Project Explorer.

Select your workbook/project and right-clickInsertModule.

Paste the macro into that module.

FileSave then Alt + q to return to Excel.

ToolsMacroMacros........select SheetCopy22 and "Run"

If you want names other than NewSheet1, 2 ,3 etc. post back for more help.


Gord Dibben MS Excel MVP

On Fri, 18 May 2007 19:13:00 -0700, Kent K
wrote:

I'm trying to figure out how to duplicate worksheet #1 and then create 54
additional worksheets without having to (copy #1 - create new worksheet -
Paste #1 onto new worksheet - repeat for each additional worksheet) Is this
possible? Using Excel 2007




  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Creating multiple worksheets...

Create the hyperlinks in A3 and A4 on the original sheet before you copy it 54
times.

InsertHyperlinkPlace in this Document.

Additional stuff...................................

You could whip over to David McRitchie's site to see his creating a TOC pages.

http://www.mvps.org/dmcritchie/excel/buildtoc.htm

Or see Debra Dalgleish's site for similar using a Toolbar.

http://www.contextures.com/xlToolbar01.html


Gord

On Fri, 18 May 2007 22:27:00 -0700, Kent K
wrote:

Also, I'm trying to figure out if I can select the same cell in all sub
worksheets and "mass" hyperlink to the TOC. The first two worksheets are
named State Directory (SD) and Regional Directory (RD) respectively. From
ws3 onward, all page layouts are identical, allowing two cells, (A3 & A4) to
be used for hyperlinking to the two directories. I would like to be able to
type SD into A3, and RD into A4 and apply it to all worksheets as well as
being able to create a hyperlink to the directories intended. Is this
possible? Thanks for the help!!


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Creating multiple worksheets...

Thanks for all the suggestions and links. I really appreciate it.

-K

"Gord Dibben" wrote:

See other post.

Gord

On Fri, 18 May 2007 22:39:00 -0700, Kent K
wrote:

sorry... one more question. Where do I start and end my "copy" of the macro
you provided?

"Gord Dibben" wrote:

Kent

Stick this macro into a general module in your workbook.

Select the sheet to copy and run the macro.

Sub SheetCopy22()
Dim i As Long
On Error GoTo endit
Application.ScreenUpdating = False
shts = InputBox("How many times?")
For i = 1 To shts
ActiveSheet.Copy After:=ActiveSheet
With ActiveSheet
.Name = "NewSheet" & i
End With
Next i
Application.ScreenUpdating = True
endit:
End Sub

To do the above "sticking" hit Alt + F11 to open the Visual Basic Editor.

CTRL + r to open the Project Explorer.

Select your workbook/project and right-clickInsertModule.

Paste the macro into that module.

FileSave then Alt + q to return to Excel.

ToolsMacroMacros........select SheetCopy22 and "Run"

If you want names other than NewSheet1, 2 ,3 etc. post back for more help.


Gord Dibben MS Excel MVP

On Fri, 18 May 2007 19:13:00 -0700, Kent K
wrote:

I'm trying to figure out how to duplicate worksheet #1 and then create 54
additional worksheets without having to (copy #1 - create new worksheet -
Paste #1 onto new worksheet - repeat for each additional worksheet) Is this
possible? Using Excel 2007




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
Creating a master sheet referenced to multiple worksheets John Excel Discussion (Misc queries) 0 November 2nd 06 03:31 PM
Creating a chart from multiple worksheets lissaski Charts and Charting in Excel 5 July 28th 06 02:27 PM
Creating a summary sheet from data across multiple worksheets Mookarts Excel Discussion (Misc queries) 1 July 17th 06 11:51 AM
Creating Tables From Multiple Worksheets carl Excel Worksheet Functions 0 January 3rd 06 09:14 PM
creating macros in multiple worksheets Shana@KL Excel Worksheet Functions 0 August 26th 05 04:49 AM


All times are GMT +1. The time now is 03:52 PM.

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"