Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Option Explicit
Sub Text() Dim allnames() As String Dim nm As Name Dim index As Long ReDim allnames(1 To ThisWorkbook.Names.Count) For Each nm In ThisWorkbook.Names index = index + 1 allnames(index) = nm.Name Next MsgBox index & " names in the array" End Sub "igorek" wrote in message ... Dave, this is not exactly what i'm trying to do. the name ranges that i'm referring to (Ctrl+F3) need to be fed into an array. And i do not know how to do that. can you please let me know how to do it via look that goes through ActiveWorkbook.Names thanks Igor "Dave Peterson" wrote: I'm not sure what you're doing, but Union sounds like it might be what you're looking for. Dim K as long dim rCtr as long dim myRngs() as range dim OneRng as range k = 3 redim myRngs(1 to K) with worksheets("Sheet9999") set myrngs(1) = .range("A1") set myrngs(2) = .range("w1:z1") set myrngs(3) = .range("L9") end with set onerng = myrngs(lbound(myrngs)) for rctr = lbound(myrngs) + 1 to ubound(myrngs) set onerng = union(onerng, myrngs(rctr)) next rctr msgbox onerng.address igorek wrote: Hi Folks, Can anyone help with the array feed please? I have numerous name ranges in the file and i want to feed an array with it. Let say i have K number of ranges. How do i feed Ranges() array with it? Thanks Igor -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Array formula: how to join 2 ranges together to form one array? | Excel Worksheet Functions | |||
looping through an array of ranges | Excel Programming | |||
Looking up named ranges as an array | Excel Programming | |||
Array and Named Ranges | Excel Programming | |||
variant array containing cel adresses convert to actual ranges-array | Excel Programming |