Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Add Worksheets


Hi Guys

Nice easy one ( I hope )

Is it possible to dictate the amount of worksheets to add as a fomula
rather than having to have a list of "Sheets.Add" 15 times

I Have a list of names ( A3:A19) that need to have a worksheet create
and named after them.

So I need the macro to calulate how many names there are in the list
It changes ) and then to create a worksheet for each and assign it tha
name

thanks

Davi

--
DB10
-----------------------------------------------------------------------
DB100's Profile: http://www.excelforum.com/member.php...nfo&userid=917
View this thread: http://www.excelforum.com/showthread.php?threadid=26922

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Add Worksheets

Hi

For i = 3 To Worksheets("YourSheet").Range("A65536").end(xlup). row
sheets.add
activesheet.name= worksheets("YourSheet").cells(i,1)
Next i

HTH
Cordially
Pascal

"DB100" a écrit dans le message de
...

Hi Guys

Nice easy one ( I hope )

Is it possible to dictate the amount of worksheets to add as a fomula,
rather than having to have a list of "Sheets.Add" 15 times

I Have a list of names ( A3:A19) that need to have a worksheet created
and named after them.

So I need the macro to calulate how many names there are in the list (
It changes ) and then to create a worksheet for each and assign it that
name

thanks

David


--
DB100
------------------------------------------------------------------------
DB100's Profile:

http://www.excelforum.com/member.php...fo&userid=9176
View this thread: http://www.excelforum.com/showthread...hreadid=269222



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Add Worksheets

You can specify the number of worksheets to add using the Count
argument to the Add method. E.g.,

Worksheets.Add Count:=15

but this will give them default names. If you need to assign
names to the worksheets, use something like

Dim Rng As Range
Dim ListRng As Range
Set ListRng = Range(Range("A3"), Range("A3").End(xlDown))
For Each Rng In ListRng
If Rng.Text < "" Then
With Worksheets
.Add(after:=.Item(.Count)).Name = Rng.Text
End With
End If
Next Rng


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"DB100" wrote in message
...

Hi Guys

Nice easy one ( I hope )

Is it possible to dictate the amount of worksheets to add as a
fomula,
rather than having to have a list of "Sheets.Add" 15 times

I Have a list of names ( A3:A19) that need to have a worksheet
created
and named after them.

So I need the macro to calulate how many names there are in the
list (
It changes ) and then to create a worksheet for each and assign
it that
name

thanks

David


--
DB100
------------------------------------------------------------------------
DB100's Profile:
http://www.excelforum.com/member.php...fo&userid=9176
View this thread:
http://www.excelforum.com/showthread...hreadid=269222



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
How use info in Excel shared worksheets to create new worksheets dkc Excel Worksheet Functions 0 June 28th 07 08:36 PM
How do i assign the ActiveWorkbook.Worksheets to a worksheets object? TS Excel Worksheet Functions 2 December 27th 06 02:49 PM
Assigning Cells in worksheets to other data in other worksheets. David McRitchie Excel Discussion (Misc queries) 0 November 27th 04 06:15 PM
Sort Numerically Worksheets via VB when creating a new worksheets John Excel Programming 6 June 1st 04 07:21 AM
Need code to protect worksheets - amount of worksheets varies Sandy[_3_] Excel Programming 1 September 9th 03 02:17 AM


All times are GMT +1. The time now is 05:20 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"