Use Names of Named Ranges in ComboBox

E

Eric Zest

Hello, i have about 20 different named ranges in a worksheet. Each named
range highlights a different range of cells.

Is there a way to add the names of these named ranges to a combobox i have
in a userform? I'm trying to use the combox in the form to select just the
name of the named range, not the cells they will highlight. Hope i make
sense. Thanks in advance!
 
P

Per Jessen

Hi

You can only list all named ranges in the workbook you have to test if
the named range is in the desired sheet.

Change Sheet1 to the name of the desired sheet.

For Each n In ActiveWorkbook.Names
If n.RefersTo Like "*Sheet1*" Then
Me.ComboBox1.AddItem n.Name
End If
Next

Regards,
Per
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top