Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem referring to drop down boxes, other objects 1

Status
Not open for further replies.

jluft

Technical User
May 4, 2004
74
US
I have named a set of 5 control boxes "Data_TransferTo1"...."DataTransferTo5"

If i put the following code in, i can access the value of each drop down

CurrentValue1 = Data_TransferTo1.value
......
CurrentValue5 = Data_TransferTo5.value

if i try this other method...
for x = 1 to 5
currentobject = "Data_TransferTo" & x
currentvalue = CurrentObject.value
next x

...the code does not work

where am i going wrong? please help!!! thanks
 
Hi,

Excel?

Forms controls or Control Toolbox controls?

On sheet or on UserForm?

Skip,

[glasses] [red]Be advised:[/red] When you ignite a firecracker in a bowl of vanilla, chocolate & strawberry ice cream, you get...
Neopolitan Blownapart! [tongue]


 
hi skip,

on excel
control toolbox controls on a sheet

i appreciate any help you can provide!
 
Try:

Code:
for x = 1 to 5
   currentobject = "Data_TransferTo" & x
   currentvalue = Me.Controls(CurrentObject).Value
next x

Gerry
 
Darn - keep forgetting to close those code tags...

Gerry
 
something like this. May have to look at the mso type too.
Code:
    For Each shp In ActiveSheet.Shapes
        CurrentObject = shp.OLEFormat.Object.Object.Text
    Next


Skip,

[glasses] [red]Be advised:[/red] When you ignite a firecracker in a bowl of vanilla, chocolate & strawberry ice cream, you get...
Neopolitan Blownapart! [tongue]


 
gerry,

unfortunately that returned the error "Invalid use of Me Keyword"

any additional thoughts?
 
skip,

great job thanks!
i manipulated waht you gave me a bit and it worked
did you know that from past experience or is there a reference that you have for that sort of minutia? thanks again
 
Yes and yes. ;-)

Skip,

[glasses] [red]Be advised:[/red] When you ignite a firecracker in a bowl of vanilla, chocolate & strawberry ice cream, you get...
Neopolitan Blownapart! [tongue]


 
Ooops, i thought it was for UserForm dropdowns. Time for a nap.

Gerry
 


Set fumei = Me.Napster
;-)

Skip,

[glasses] [red]Be advised:[/red] When you ignite a firecracker in a bowl of vanilla, chocolate & strawberry ice cream, you get...
Neopolitan Blownapart! [tongue]


 
You just crack me up sometimes. However, it is more like:

Set fumei = Nothing

Need a nap, as I have to jump on a plane and fly across the continent, and I NEVER can nap on planes. Nine hours...

Set fumei = GetMeOutOfThisCan.NeedADrink

Gerry
 


Bummer! I can pretty much sleep anywhere.

Skip,

[glasses] [red]Be advised:[/red] When you ignite a firecracker in a bowl of vanilla, chocolate & strawberry ice cream, you get...
Neopolitan Blownapart! [tongue]


 
hate people who can sleep anywhere.....where do you live? I get - at most - 90 minutes per day. Many many brain studies have been done, and while definitely cool to get a CD of MRI images....I would rather be able to sleep.

where do you live?....just kidding.

Gerry
 


Texas, y'all! ;-)

Skip,

[glasses] [red]Be advised:[/red] When you ignite a firecracker in a bowl of vanilla, chocolate & strawberry ice cream, you get...
Neopolitan Blownapart! [tongue]


 
guys,
thanks very much for the help yesterday
i must ask a favor though
please stop emailing each other over this network!! i have received abotu 10 notifications about your conversation. thanks in advance
 

Hey, jluft,

That's the "price of doing business."

You can always turn off notification on this thread.

Skip,

[glasses] [red]Be advised:[/red] When you ignite a firecracker in a bowl of vanilla, chocolate & strawberry ice cream, you get...
Neopolitan Blownapart! [tongue]


 
ah skip,

you have all the answers

IF
answer = elusive
THEN
Call Skip
ELSE
skiparray = ("Awesome","Cool","Dude")
END IF

 


I'm actually...

nurdie, geekie, ol' fart! ;-)


Skip,

[glasses] [red]Be advised:[/red] When you ignite a firecracker in a bowl of vanilla, chocolate & strawberry ice cream, you get...
Neopolitan Blownapart! [tongue]


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top