+ Reply to Thread
Results 1 to 6 of 6

Calling a sub method

  1. #1
    Registered User
    Join Date
    04-03-2006
    Posts
    7

    Calling a sub method

    Hi,

    I have the name of my sub method stored in a variable:

    mySubMethodName = "do_something"

    I then want to call this method using the variable, I have tried
    the following but it doesn't work:

    Call mySubMethodName

    Is there anyway to do what I am trying to do?

  2. #2
    Christian
    Guest

    Re: Calling a sub method


    richcoleuk wrote:
    > Hi,
    >
    > I have the name of my sub method stored in a variable:
    >
    > mySubMethodName = "do_something"
    >
    > I then want to call this method using the variable, I have tried
    > the following but it doesn't work:
    >
    > Call mySubMethodName
    >
    > Is there anyway to do what I am trying to do?
    >
    >
    > --
    > richcoleuk
    > ------------------------------------------------------------------------
    > richcoleuk's Profile: http://www.excelforum.com/member.php...o&userid=33103
    > View this thread: http://www.excelforum.com/showthread...hreadid=549375



    Why don't you just use

    Call do_something

    Christian


  3. #3
    Registered User
    Join Date
    04-03-2006
    Posts
    7
    because the name of the sub method is specified on the worksheet, and this value is taken from the sheet.

  4. #4
    NickHK
    Guest

    Re: Calling a sub method

    richcoleuk,
    Application.Run ?

    NickHK

    "richcoleuk" <[email protected]> wrote
    in message news:[email protected]...
    >
    > Hi,
    >
    > I have the name of my sub method stored in a variable:
    >
    > mySubMethodName = "do_something"
    >
    > I then want to call this method using the variable, I have tried
    > the following but it doesn't work:
    >
    > Call mySubMethodName
    >
    > Is there anyway to do what I am trying to do?
    >
    >
    > --
    > richcoleuk
    > ------------------------------------------------------------------------
    > richcoleuk's Profile:

    http://www.excelforum.com/member.php...o&userid=33103
    > View this thread: http://www.excelforum.com/showthread...hreadid=549375
    >




  5. #5
    Registered User
    Join Date
    04-03-2006
    Posts
    7
    Works a charm, thanks Nick

  6. #6
    Bob Phillips
    Guest

    Re: Calling a sub method

    Application.Run variable_name

    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "richcoleuk" <[email protected]> wrote
    in message news:[email protected]...
    >
    > because the name of the sub method is specified on the worksheet, and
    > this value is taken from the sheet.
    >
    >
    > --
    > richcoleuk
    > ------------------------------------------------------------------------
    > richcoleuk's Profile:

    http://www.excelforum.com/member.php...o&userid=33103
    > View this thread: http://www.excelforum.com/showthread...hreadid=549375
    >




+ 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