+ Reply to Thread
Results 1 to 3 of 3

Variable procedure call

  1. #1
    Art
    Guest

    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. #2
    Dave Peterson
    Guest

    Re: 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. #3
    Art
    Guest

    Re: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1