View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Fredrik Wahlgren Fredrik Wahlgren is offline
external usenet poster
 
Posts: 339
Default VBA Equivalent of ASP 'Execute' Command


"The Vision Thing" wrote in message
...
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.



I think Application.Evaluate is what you are looking for.

/Fredrik