Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default Convert String variable to code

Surely

sProperty = textbox1.tag
msgbox("Custom Object Property = " & sProperty)

gets what you want?


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Hokievandal" wrote in message
...
Hello all,
Is there a way to pass a string variable such as "textBox1.visible=true"
to
be read as code? I'm wanting to store short object properties within
control
tags to reduce code so that the program can loop through several text
boxes
and return values using the text in the control tag.

Simplified example;

dim Task as CustomObject
sProperty = textbox1.tag
msgbox("Custom Object Property = " & task.sProperty)

Thanks!



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default Convert String variable to code

Is the user input the control name? If so,

MsgBox Me.Controls(sStringCommand).Left

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Hokievandal" wrote in message
...
I didn't state my question very well. Instead, how could i make the
following work?
Dim sStringCommand as String

sStringCommand = "msgbox("Enter Name:")
call sStringCommand and have the code 'MsgBox... ' run

Thanks again,
Ryan



"Bob Phillips" wrote:

Surely

sProperty = textbox1.tag
msgbox("Custom Object Property = " & sProperty)

gets what you want?


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Hokievandal" wrote in message
...
Hello all,
Is there a way to pass a string variable such as
"textBox1.visible=true"
to
be read as code? I'm wanting to store short object properties within
control
tags to reduce code so that the program can loop through several text
boxes
and return values using the text in the control tag.

Simplified example;

dim Task as CustomObject
sProperty = textbox1.tag
msgbox("Custom Object Property = " & task.sProperty)

Thanks!






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
convert text string to a number code ramon Excel Discussion (Misc queries) 5 April 11th 07 05:02 PM
Convert string to variable Jason Morin Excel Programming 2 September 27th 06 07:13 PM
incorporate string variable into VB code itsthebike[_3_] Excel Programming 1 September 22nd 05 06:16 PM
How do I convert an integer variable to a string variable? dumbass Excel Programming 2 May 21st 04 07:34 PM
VBA - Convert my variable range array to single cell string Kevin G[_2_] Excel Programming 6 January 28th 04 07:20 AM


All times are GMT +1. The time now is 01:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"