Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm not sure there aren't better ways to achieve this - declaring
variables on the fly is not really good practise. You would be much better off using a dictionary object or array for what you're trying to do. Tim. "The Vision Thing" wrote in message ... Thanks Dave, that's what I needed to know. Wayne C. "Dave Peterson" wrote in message ... VBA doesn't support that kind of symbolic substitution. The Vision Thing wrote: "Dave Peterson" wrote in message ... Are you executing a different program? Take a look at Shell in VBA's help. Are you running a different subroutine? Application.Run maybe it. The Vision Thing wrote: Is there a VBA equivalent of ASP's 'Execute' command. I'd like to use such a command to dynamically declare variables at run-time. Here's a sample of ASP 'Execute' code. --------------------------- varID = fp_rs("ID") varName = fp_rs("Name") varOccupation = fp_rs("Occupation") for i = 1 to numFields Execute("var" & arr_fieldnames(i) & " = fp_rs(""" & arr_fieldnames(i) & """)" next --------------------------- Thanks, Wayne C. -- Dave Peterson What I'm trying to do is dynamically declare variables and assign values to them, like so For i = 1 to Ubound(arrIn) Dim ("var" & arrIn(i)) as string ("var" & arrIn(i)) = arrIn(i) Next Regards, Wayne C. -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I execute command from button or hyperlink? | Excel Discussion (Misc queries) | |||
Command button - won't execute twice in sequence | Excel Programming | |||
Programming command button to execute on a different worksheet | Excel Programming | |||
Execute a menu command with VBA? | Excel Programming | |||
Execute a command line app but i want a string returned. | Excel Programming |