Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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?


--
richcoleuk
------------------------------------------------------------------------
richcoleuk's Profile: http://www.excelforum.com/member.php...o&userid=33103
View this thread: http://www.excelforum.com/showthread...hreadid=549375

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Calling a sub method


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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Calling a sub method

richcoleuk,
Application.Run ?

NickHK

"richcoleuk" wrote
in message ...

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Calling a sub method

Application.Run variable_name

--
HTH

Bob Phillips

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

"richcoleuk" wrote
in message ...

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





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Calling a sub method


Works a charm, thanks Nic

--
richcoleu
-----------------------------------------------------------------------
richcoleuk's Profile: http://www.excelforum.com/member.php...fo&userid=3310
View this thread: http://www.excelforum.com/showthread.php?threadid=54937

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
Please post this thread a correct full method, method about Nast Runsome New Users to Excel 8 February 25th 08 03:29 PM
Please post this thread a complete correct method, method about te Nast Runsome New Users to Excel 0 February 23rd 08 09:42 PM
Calling Excel/Opentext method via ActiveX in a service application Salar Madadi Excel Programming 1 January 30th 06 11:33 PM
Calling from C#.Net App Office._CommandBarButton.Execute() method in Excel 2003 throws a COMException Jacek Excel Programming 1 December 21st 03 03:48 PM
Calling a module function from a class method ranafout[_2_] Excel Programming 1 November 12th 03 11:08 AM


All times are GMT +1. The time now is 04:58 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"