View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Store strings in a Define Name

Should work providing your named array looks something like this in the
refersto -
={"A", "B", "C", 1, 2, 3}"

Also total length incl "={}" and any internal quotes should be under 255
characters (255+ might be doable but highly convoluted). Depending on how
the refersto array is made may need to double up quotes around any internal
string values in the array

Also check what the name evaluates to

v = Application.Evaluate(Me.Parent.Names("defined_name ").RefersTo
If isarray(v) then
ComboBox1.List = V
elseif iserror(v) then
'hmm

Regards,
Peter T


"Jim May" wrote in message
...
Thanks Bob, But why do I now get:
R/T error 381
Could not set the List Property. Invalid property arrat index.


"Bob Phillips" wrote:

Hey Jim,

Didn't think you were Snowfire, just that your comment seemed so inline

with
the original. Anyway, ...

If you use a combobox from the control toolbox, you could load it on the
click of the arrow

Private Sub ComboBox1_DropButtonClick()
ComboBox1.List =
Application.Evaluate(Me.Parent.Names("defined_name ").RefersTo)
End Sub


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my

addy)



"Jim May" wrote in message
...
Yes Bob, my apology.. You are Right -- I am not Snowfire as you

assumed -
I
just try to learn by looking over the shoulder of others that do not
know...
Actually, My first "impression" was to put the one-linner inside of

the On
Focus event, then second inside the Worksheet_Activate Code.. But both
without success.. Therein the Q...
Can you OPEN MY EYES?
Jim

"Bob Phillips" wrote:

Jim,

You are not Snowfire are you?

I was assuming that the combobox was on a userform, in which case it
would
be in the userform activate event.

If it was a combobox on a worksheet, it will need a bit of

modification.
Then I guess you would execute it in the worksheet activate event.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"Jim May" wrote in message
...
Bob,
Still not familiar enough to know where to put your suggested

one-line
of
code.
If the ComboBox1 is, of course Sheet1 then no doubt in the sheet1

code
window..
But inside what event handler?
Thanks,
Jim

"Bob Phillips" wrote:

Me.ComboBox1.List =
Application.Evaluate(Names("defined_name").RefersT o)


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in

my
addy)



"Snowfire" wrote in message
ups.com...
I want to store an array of Emailnames in a Define Name "range"

so
they are semi hidden.
How can I add to an existing list and how can I retrieve name

from
this stored list to a Combo. I have worked out how to create an
initial list and load this into a combo but lost on manipulating

it.