Populate a list box with named ranges.....

C

Chris Salcedo

I am trying to populate a list box with all the named ranges in a
sheet. The following code gives me only the refers to portion of the
name not the name itself. What am I doing wrong ???


Private Sub UserForm_Initialize()
For Each nName In Names
Me.ListBox1.AddItem (nName)
Next nName
End Sub

Thanks

Chris
 
N

Norman Jones

Hi Chris,

Try:

'============>>
Private Sub UserForm_Initialize()
Dim nName As Name
For Each nName In Names
Me.ListBox1.AddItem (nName.Name)
Next nName
End Sub

'<<============
 
C

Chris Salcedo

Well that did it. It was so simple the that I just couldnt see it...
Its time for bed......

Thanks..
Chris

zzZZZZZz...
 

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

Similar Threads


Top