Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default sub call with string

hello
i have a combobox were i chose a value and like to run a sub
were the name of the value is the name of the sub
how do i do


  #2   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default sub call with string

try using

Application.Run (MacroName)


"aran" wrote:

hello
i have a combobox were i chose a value and like to run a sub
were the name of the value is the name of the sub
how do i do


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default sub call with string

Hello thanks
that seem to work on macros but if i like too run a sub in the same sheet

"JMB" wrote:

try using

Application.Run (MacroName)


"aran" wrote:

hello
i have a combobox were i chose a value and like to run a sub
were the name of the value is the name of the sub
how do i do


  #4   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default sub call with string

A sub in the same sheet? Is the sub an event handler or just a regular
macro? If it's just a regular macro I'd move it to a regular module (I don't
think VBA looks for plain-vanilla macros in the sheet modules). If you're
trying to call an event handler, can you move the guts of your second event
handler to a macro in a standard module and replace with a call to the macro
(ie both event handlers would call the same macro).


"aran" wrote:

Hello thanks
that seem to work on macros but if i like too run a sub in the same sheet

"JMB" wrote:

try using

Application.Run (MacroName)


"aran" wrote:

hello
i have a combobox were i chose a value and like to run a sub
were the name of the value is the name of the sub
how do i do


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default sub call with string

Thanks
Is it better to have the most subs in module
and can i have as many subs i want in one module

"JMB" wrote:

A sub in the same sheet? Is the sub an event handler or just a regular
macro? If it's just a regular macro I'd move it to a regular module (I don't
think VBA looks for plain-vanilla macros in the sheet modules). If you're
trying to call an event handler, can you move the guts of your second event
handler to a macro in a standard module and replace with a call to the macro
(ie both event handlers would call the same macro).


"aran" wrote:

Hello thanks
that seem to work on macros but if i like too run a sub in the same sheet

"JMB" wrote:

try using

Application.Run (MacroName)


"aran" wrote:

hello
i have a combobox were i chose a value and like to run a sub
were the name of the value is the name of the sub
how do i do




  #6   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default sub call with string

I have not run into problems with limits on the number of macros in a module.
If you want, you can add more modules. I've never run into problems w/not
being able to add enough modules either.

I think it's better practice to keep your macros and functions in standard
code modules and your worksheet level event handlers in your worksheet
modules. Excel doesn't always look for a public macro in a worksheet module.
If you create a button using the forms toolbar, you cannot assign any macros
from the worksheet modules - Excel does not make those available, which makes
sense as event handlers cannot be called in that fashion.




"aran" wrote:

Thanks
Is it better to have the most subs in module
and can i have as many subs i want in one module

"JMB" wrote:

A sub in the same sheet? Is the sub an event handler or just a regular
macro? If it's just a regular macro I'd move it to a regular module (I don't
think VBA looks for plain-vanilla macros in the sheet modules). If you're
trying to call an event handler, can you move the guts of your second event
handler to a macro in a standard module and replace with a call to the macro
(ie both event handlers would call the same macro).


"aran" wrote:

Hello thanks
that seem to work on macros but if i like too run a sub in the same sheet

"JMB" wrote:

try using

Application.Run (MacroName)


"aran" wrote:

hello
i have a combobox were i chose a value and like to run a sub
were the name of the value is the name of the sub
how do i do


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
Excel: Use pic location string to call up picuture in cell? vloh28 Excel Discussion (Misc queries) 1 October 30th 07 12:42 AM
Call Center Management: How to calculate 'cost per call' Denniso6 Excel Discussion (Misc queries) 2 June 25th 06 05:01 PM
to search for a string and affect data if it finds the string? Shwaman Excel Worksheet Functions 1 January 11th 06 12:56 AM
Excel4 Call to get Function String Rob Bovey Excel Programming 6 September 24th 03 06:34 PM
Create a formula into a String then assign string to a cell Myrna Larson[_2_] Excel Programming 6 August 23rd 03 09:42 PM


All times are GMT +1. The time now is 06:51 AM.

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"