EconSean
Board Regular
- Joined
- Apr 21, 2002
- Messages
- 129
Greetings all,
I have a file with a number of named ranges. I would like to have a routine that lists out all of the named ranges (throughout the file, not just on one page) and display all of these names on a sheet.
I have come up with this loop, but it doesn't work exactly right just yet.
Basically, it gets to the last name in the workbook and then fills in 100 cells with the range. I arbitrarily picked 100; I really would like to loop through all named ranges in the file, whether there are 10, 100, or 1000 ranges.
I would like each row to be a unique name. Is there a way to list the name AND the range that the name refers to?
Thanks in advance.
Kind Regards,
Sean
Public Sub ShowNames()
Dim Nm As Name
Dim i As Long
For Each Nm In ActiveWorkbook.Names
For i = 1 To 100
Range("A1").Offset(i, 0).Value = Nm
Next i
Next Nm
End Sub
I have a file with a number of named ranges. I would like to have a routine that lists out all of the named ranges (throughout the file, not just on one page) and display all of these names on a sheet.
I have come up with this loop, but it doesn't work exactly right just yet.
Basically, it gets to the last name in the workbook and then fills in 100 cells with the range. I arbitrarily picked 100; I really would like to loop through all named ranges in the file, whether there are 10, 100, or 1000 ranges.
I would like each row to be a unique name. Is there a way to list the name AND the range that the name refers to?
Thanks in advance.
Kind Regards,
Sean
Public Sub ShowNames()
Dim Nm As Name
Dim i As Long
For Each Nm In ActiveWorkbook.Names
For i = 1 To 100
Range("A1").Offset(i, 0).Value = Nm
Next i
Next Nm
End Sub