ndendrinos
Well-known Member
- Joined
- Jan 17, 2003
- Messages
- 1,694
Because of the number of cells I had to incorporate in a named range I broke same into four then to run it I use this:
Before I run the code I look at my named ranges and there is no "searchall"
After I run the code a new named range is created named "searchall"
When I look at it it has bits and pieces of the four named ranges in it but not a complete list of those cells.
The code works great but still I am curious.
Can anyone explain it?
As far as I can tell nothing in the code suggest the creation of this new named range (that's the way I read it anyway)
Many thanks
Code:
Sub search()
Application.Union([searchone], [searchtwo], [searchthree], [searchfour]).Name = "searchall"
Dim i As Long
Dim rngCell As Range
i = 1
For Each rngCell In [searchall]
rngCell.Value = Range("toplistall")(i)
i = i + 1
Next
End Sub
Before I run the code I look at my named ranges and there is no "searchall"
After I run the code a new named range is created named "searchall"
When I look at it it has bits and pieces of the four named ranges in it but not a complete list of those cells.
The code works great but still I am curious.
Can anyone explain it?
As far as I can tell nothing in the code suggest the creation of this new named range (that's the way I read it anyway)
Many thanks