PC Review


Reply
Thread Tools Rate Thread

Defined named range (Array list)

 
 
Sinner
Guest
Posts: n/a
 
      16th Feb 2008
Hi,

I have a defined name 'ActivityList' with refer to:
={"Basic","Prime"...................."} and so on with move than 13 to
15 entries upto 30+ which keep on updating.

Basically using it with sumproduct formula.
=SUMPRODUCT(--(ActivityList=$B$25),(AMTList)+(DiscountList),--
(DateList=O$5))

The problem I'm having is that it does not allow more than 13 to 15
entries.

Any work around would be appreciated.
 
Reply With Quote
 
 
 
 
Peter T
Guest
Posts: n/a
 
      16th Feb 2008
You are being hit by the 255 limit of the refersto string. Try this on a new
sheet -

Sub test()
Dim i As Long, n As Long
Dim rName As Range, rng As Range

For i = 1 To 200 Step 2
With Cells(i, 1)
n = n + 1
.Name = "theCell_" & Right("0" & n, 3)
.Value = 1
End With
Next

For n = 1 To 100
Set rName = Range("theCell_" & Right("0" & n, 3))
If rng Is Nothing Then
Set rng = rName
Else
Set rng = Union(rng, rName)
End If
Next

ActiveWorkbook.Names.Add "BigName", rng

Range("BigName").Select
MsgBox Selection.Count
End Sub

With this method you'll be limited to between 149-224 areas in the big name,
depending on the combination of single & multiple cells. With other methods
you can include several thousand non-contiguous ranges in a single name, but
requires quite a bit of code to manage it all.

Regards,
Peter T


"Sinner" <(E-Mail Removed)> wrote in message
news:ac708ea4-4f92-4edc-b040-(E-Mail Removed)...
> Hi,
>
> I have a defined name 'ActivityList' with refer to:
> ={"Basic","Prime"...................."} and so on with move than 13 to
> 15 entries upto 30+ which keep on updating.
>
> Basically using it with sumproduct formula.
> =SUMPRODUCT(--(ActivityList=$B$25),(AMTList)+(DiscountList),--
> (DateList=O$5))
>
> The problem I'm having is that it does not allow more than 13 to 15
> entries.
>
> Any work around would be appreciated.



 
Reply With Quote
 
Sinner
Guest
Posts: n/a
 
      16th Feb 2008
Thx Peter.
Appreciate that.


On Feb 16, 5:00*pm, "Peter T" <peter_t@discussions> wrote:
> You are being hit by the 255 limit of the refersto string. Try this on a new
> sheet -
>
> Sub test()
> Dim i As Long, n As Long
> Dim rName As Range, rng As Range
>
> * * For i = 1 To 200 Step 2
> * * * * With Cells(i, 1)
> * * * * * * n = n + 1
> * * * * * * .Name = "theCell_" & Right("0" & n, 3)
> * * * * * * .Value = 1
> * * * * End With
> * * Next
>
> * * For n = 1 To 100
> * * * * Set rName = Range("theCell_" & Right("0" & n, 3))
> * * * * If rng Is Nothing Then
> * * * * * * Set rng = rName
> * * * * Else
> * * * * * * Set rng = Union(rng, rName)
> * * * * End If
> * * Next
>
> * * ActiveWorkbook.Names.Add "BigName", rng
>
> * * Range("BigName").Select
> * * MsgBox Selection.Count
> End Sub
>
> With this method you'll be limited to between 149-224 areas in the big name,
> depending on the combination of single & multiple cells. *With other methods
> you can include several thousand non-contiguous ranges in a single name, but
> requires quite a bit of code to manage it all.
>
> Regards,
> Peter T
>
> "Sinner" <ims...@gmail.com> wrote in message
>
> news:ac708ea4-4f92-4edc-b040-(E-Mail Removed)...
>
>
>
> > Hi,

>
> > I have a defined name 'ActivityList' with refer to:
> > ={"Basic","Prime"...................."} and so on with move than 13 to
> > 15 entries upto 30+ which keep on updating.

>
> > Basically using it with sumproduct formula.
> > =SUMPRODUCT(--(ActivityList=$B$25),(AMTList)+(DiscountList),--
> > (DateList=O$5))

>
> > The problem I'm having is that it does not allow more than 13 to 15
> > entries.

>
> > Any work around would be appreciated.- Hide quoted text -

>
> - Show quoted text -


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
a data validation list that contains a list of named ranges - not alist from a named range BoringAccountant Microsoft Excel Worksheet Functions 1 9th Jul 2010 12:12 AM
populate array with list of named range LetMeDoIt Microsoft Excel Programming 5 1st May 2008 11:36 PM
VBA defined named range not appearing in Names list... =?Utf-8?B?R2Vvcmdl?= Microsoft Excel Programming 13 15th Oct 2007 05:45 PM
Using a data validation list to look up a defined named range in another worksheet Laura Hunt Microsoft Excel Charting 0 24th Nov 2005 02:29 PM
Defined named range to array MattShoreson Microsoft Excel Programming 1 4th Dec 2003 10:06 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:01 PM.