Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default How do I create a worksheet using a drop down list?

Hi guys,

Is there any way to create a worksheet using a drop down list? For example,
if I had a drop down list consisting of M and B, selecting one of the two
values would create a worksheet with the name M with preassigned formulae and
values in the sheet?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 138
Default How do I create a worksheet using a drop down list?

The easiest way would be to prepare the 2 worksheets and hide them. Then
attach a simple unhide macro to your drop down list. If you really want to
create all sheet contents on-the-fly you would have to take additional
precautions so that another selection from your drop down list doesn't
overwrite an already existing sheet M with a fresh version.

Joerg


"TodiHawk" wrote in message
...
Hi guys,

Is there any way to create a worksheet using a drop down list? For
example,
if I had a drop down list consisting of M and B, selecting one of the two
values would create a worksheet with the name M with preassigned formulae
and
values in the sheet?

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default How do I create a worksheet using a drop down list?

Try this, assuming the DV is in cell H1

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Worksheets.Add.Name = .Value
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"TodiHawk" wrote in message
...
Hi guys,

Is there any way to create a worksheet using a drop down list? For
example,
if I had a drop down list consisting of M and B, selecting one of the two
values would create a worksheet with the name M with preassigned formulae
and
values in the sheet?

Thanks



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
create a drop down list Harper Excel Worksheet Functions 2 February 22nd 06 06:42 PM
Can I create a drop-down list that will reference other drop-down fdebelo Excel Worksheet Functions 3 January 7th 06 09:34 AM
How To Create A Drop Down List? travelersway New Users to Excel 4 August 11th 05 02:25 AM
How do I create a simple drop down box/List SweetShellyGal Excel Discussion (Misc queries) 1 March 11th 05 05:00 PM
How do you create a drop down list? Aviator Excel Discussion (Misc queries) 2 December 28th 04 03:07 PM


All times are GMT +1. The time now is 07:38 AM.

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"