Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Adding Sheets with names from a list.


Hi everybody,
I have a routine that adds a new worksheet for each value in a Dynamic
Named Range. The range points to the correct data and the routine works
fine to a point, but always seems to stop short of creating all the
sheets. The named range currently is 220 cells and starts with 001 and
ends at 391. Obviously there are missing numbers in the sequence, but
the numbers are sorted ascending. Any ideas why the rountine would just
stop part way through??

Here is the code:

Option Explicit

Sub CreateRoomSheets()

Dim WB As Workbook
Dim Sht As Worksheet
Dim rng As Range
Dim rCell As Range


Set WB = ThisWorkbook
Set Sht = WB.Sheets("Room Blank")
Set rng = WB.Sheets("Room List").Range("RoomNo")


On Error GoTo RET
Application.ScreenUpdating = False


For Each rCell In rng.Cells
With rCell
Sht.Copy After:=WB.Sheets(WB.Sheets.Count)
ActiveSheet.Name = .Value
End With
Next rCell

RET:
Application.ScreenUpdating = True
End Sub


--
Casey


------------------------------------------------------------------------
Casey's Profile: http://www.excelforum.com/member.php...fo&userid=4545
View this thread: http://www.excelforum.com/showthread...hreadid=529613

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default Adding Sheets with names from a list.

Hello
I may be wrong but you may have reached the limit in the number of sheets
you can create.
This is a specification in Excel and related to the available memory of your
PC.

HTH
Cordially
Pascal

"Casey" a écrit dans le
message de news: ...

Hi everybody,
I have a routine that adds a new worksheet for each value in a Dynamic
Named Range. The range points to the correct data and the routine works
fine to a point, but always seems to stop short of creating all the
sheets. The named range currently is 220 cells and starts with 001 and
ends at 391. Obviously there are missing numbers in the sequence, but
the numbers are sorted ascending. Any ideas why the rountine would just
stop part way through??

Here is the code:

Option Explicit

Sub CreateRoomSheets()

Dim WB As Workbook
Dim Sht As Worksheet
Dim rng As Range
Dim rCell As Range


Set WB = ThisWorkbook
Set Sht = WB.Sheets("Room Blank")
Set rng = WB.Sheets("Room List").Range("RoomNo")


On Error GoTo RET
Application.ScreenUpdating = False


For Each rCell In rng.Cells
With rCell
Sht.Copy After:=WB.Sheets(WB.Sheets.Count)
ActiveSheet.Name = .Value
End With
Next rCell

RET:
Application.ScreenUpdating = True
End Sub


--
Casey


------------------------------------------------------------------------
Casey's Profile:
http://www.excelforum.com/member.php...fo&userid=4545
View this thread: http://www.excelforum.com/showthread...hreadid=529613



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Adding Sheets with names from a list.


Papou,
Thanks for the reply, however my workstation has 1 gig of ram and the
Workbook in question has never grown past 353KB when it had 150 of
these sheets. (they are fairly simple)


--
Casey


------------------------------------------------------------------------
Casey's Profile: http://www.excelforum.com/member.php...fo&userid=4545
View this thread: http://www.excelforum.com/showthread...hreadid=529613

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 can I print the names of all the sheets in a list? SUN Excel Discussion (Misc queries) 1 October 7th 09 08:43 AM
Print list of names of all sheets in a workbook Jo Excel Discussion (Misc queries) 1 September 24th 09 05:00 PM
create a random list of names from a list of names in EXCEL Givvie Excel Worksheet Functions 2 October 23rd 06 05:10 AM
how do i set up a list of names on a sheet frm various sheets in e mcvities_69 Excel Discussion (Misc queries) 1 January 27th 06 02:51 AM
Rename Multiple Sheets from a List of Available Names prkhan56 Excel Programming 5 April 4th 05 06:07 PM


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