Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Drop-down-list with Named ranges

I have searched the net but could not find a solution for the
following:

I have a sheet with about 100 named ranges (multiple columns and rows).
The user has to pick 2 or 3 Named ranges to copy to another file.

Question is how to prompt a list of all Named ranges (preferably from
all sheets) from which the user can pick one, to select the range after
which it can be copied.

An alternative might be that the user is prompted to select a named
range from a drop-down list embedded in the sheet. Problem is I cannot
create this list nor retrieve the proper range from it.

I would appreciate any help or suggestion.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Drop-down-list with Named ranges

Hi there, try this code. You'll need to create a Embeded ComboBox and
call it cmdNamesCombo.

Private Sub Worksheet_Activate()
cmdNamesCombo.Clear

'populate list with named ranges
For intnamescount = 1 To Application.Names.Count
cmdNamesCombo.AddItem (Application.Names(intnamescount).Name)
Next intnamescount
End Sub
Private Sub cmdNamesCombo_Click()
'Goes to selected range name and copies it
Application.Goto Application.Names(cmdNamesCombo.Value).Name
Selection.Copy
End Sub

FunkySquid

Chootje wrote:
I have searched the net but could not find a solution for the
following:

I have a sheet with about 100 named ranges (multiple columns and rows).
The user has to pick 2 or 3 Named ranges to copy to another file.

Question is how to prompt a list of all Named ranges (preferably from
all sheets) from which the user can pick one, to select the range after
which it can be copied.

An alternative might be that the user is prompted to select a named
range from a drop-down list embedded in the sheet. Problem is I cannot
create this list nor retrieve the proper range from it.

I would appreciate any help or suggestion.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Drop-down-list with Named ranges

Thanks FunkySquid - gonna work on that.

FunkySquid wrote:
Hi there, try this code. You'll need to create a Embeded ComboBox and
call it cmdNamesCombo.

Private Sub Worksheet_Activate()
cmdNamesCombo.Clear

'populate list with named ranges
For intnamescount = 1 To Application.Names.Count
cmdNamesCombo.AddItem (Application.Names(intnamescount).Name)
Next intnamescount
End Sub
Private Sub cmdNamesCombo_Click()
'Goes to selected range name and copies it
Application.Goto Application.Names(cmdNamesCombo.Value).Name
Selection.Copy
End Sub

FunkySquid

Chootje wrote:
I have searched the net but could not find a solution for the
following:

I have a sheet with about 100 named ranges (multiple columns and rows).
The user has to pick 2 or 3 Named ranges to copy to another file.

Question is how to prompt a list of all Named ranges (preferably from
all sheets) from which the user can pick one, to select the range after
which it can be copied.

An alternative might be that the user is prompted to select a named
range from a drop-down list embedded in the sheet. Problem is I cannot
create this list nor retrieve the proper range from it.

I would appreciate any help or suggestion.


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
list of named ranges rolando Excel Discussion (Misc queries) 3 November 4th 08 08:22 PM
Named ranges dissapear from list Susan Excel Discussion (Misc queries) 4 September 6th 08 04:39 AM
Create list of Named Ranges Jim Tibbetts Excel Worksheet Functions 4 February 15th 07 05:29 PM
Named Ranges don't show up in drop-down list hds Excel Discussion (Misc queries) 14 July 3rd 06 09:30 PM
Printing a list of all named ranges Joe Smith Excel Programming 3 October 2nd 03 08:21 PM


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