+ Reply to Thread
Results 1 to 3 of 3

Drop-down-list with Named ranges

  1. #1
    Chootje
    Guest

    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. #2
    FunkySquid
    Guest

    Re: 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. #3
    Chootje
    Guest

    Re: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1