Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Creating worksheets and auto listing them

Hi there

I'm looking for help to automatically create a new worksheet (based o
a defined template preferably)...the new worksheet would be create
based on the name of a new item in a list of items - as soon as a ne
item is added...

Alternatively I could create all the worksheets (hide the ones/templat
worksheets that are not in use), but then I need a formula to list al
the worksheet names in a list/coloumn...and update the list as soon a
a worksheet name is changed.

Any ideas?

Thanks in advance

Ja

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Creating worksheets and auto listing them

Hi Jac,

Create a template sheet called Template and hide it.

Put this code in the worksheet code module of the worksheet that maintains
the list (right-click on the sheet tab, select View Code, and paste the
code).

It assumes the list is in A1:A10, adjust to suit.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim oWs As Worksheet
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1:A10")) Is Nothing Then
On Error Resume Next
Set oWs = ActiveWorkbook.Worksheets(Target.Value)
On Error GoTo ws_exit
If oWs Is Nothing Then
Worksheets("Template").Copy after:=Worksheets(Worksheets.Count)
ActiveSheet.Name = Target.Value
End If
End If

ws_exit:
Application.EnableEvents = True
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"jacurrie " wrote in message
...
Hi there

I'm looking for help to automatically create a new worksheet (based on
a defined template preferably)...the new worksheet would be created
based on the name of a new item in a list of items - as soon as a new
item is added...

Alternatively I could create all the worksheets (hide the ones/template
worksheets that are not in use), but then I need a formula to list all
the worksheet names in a list/coloumn...and update the list as soon as
a worksheet name is changed.

Any ideas?

Thanks in advance

Jac


---
Message posted from http://www.ExcelForum.com/



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 listing from a drop down box David Excel Discussion (Misc queries) 2 October 10th 08 12:02 AM
Listing the names of your worksheets gunslinger Excel Discussion (Misc queries) 3 May 30th 06 11:12 PM
Find duplicate entries within mulitple worksheets, then listing th Gayla Excel Worksheet Functions 1 May 17th 06 02:43 AM
Listing data from multiple worksheets scottcts Excel Worksheet Functions 3 August 12th 05 05:55 PM
Can Sales Listing from Worksheet #1 go to individual worksheets? GeorgeF. Excel Worksheet Functions 2 December 2nd 04 08:49 PM


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