Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Art Art is offline
external usenet poster
 
Posts: 587
Default Variable procedure call

Hi,

Does anyone know if I can, during runtime, call a procedure with a variable
name? For example, I'd like to pass a parameter to a calling procedure, and
then based on that parameter call another procedure. I'm sure I cheat and do
it with a select statement, but I'd like to do it more directly if possible.

Thanks,

Art
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Variable procedure call

dim myStr as string
mystr = "Sub1"
application.run "'" & thisworkbook.name & "'!" & mystr





Art wrote:

Hi,

Does anyone know if I can, during runtime, call a procedure with a variable
name? For example, I'd like to pass a parameter to a calling procedure, and
then based on that parameter call another procedure. I'm sure I cheat and do
it with a select statement, but I'd like to do it more directly if possible.

Thanks,

Art


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
Art Art is offline
external usenet poster
 
Posts: 587
Default Variable procedure call

Dave - FANTASTIC!

I really needed to do this, but frankly thought it couldn't be done. I
figured I had nothing to lose by asking. This is great! This will really
simplify a bunch of stuff in my application.

Thanks,

Art

"Dave Peterson" wrote:

dim myStr as string
mystr = "Sub1"
application.run "'" & thisworkbook.name & "'!" & mystr





Art wrote:

Hi,

Does anyone know if I can, during runtime, call a procedure with a variable
name? For example, I'd like to pass a parameter to a calling procedure, and
then based on that parameter call another procedure. I'm sure I cheat and do
it with a select statement, but I'd like to do it more directly if possible.

Thanks,

Art


--

Dave Peterson

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
Call procedure using variable donbowyer Excel Programming 2 October 28th 05 09:21 AM
Where else to look for procedure call Lulu Excel Programming 0 November 24th 04 03:07 PM
can I call a procedure using a variable Santiago Gomez Excel Programming 8 December 24th 03 09:08 PM
call procedure bob Excel Programming 1 August 9th 03 12:40 AM
procedure won't call John Gittins Excel Programming 0 August 5th 03 08:17 PM


All times are GMT +1. The time now is 10:27 PM.

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"