LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default Can't call a subroutine

Excel 2003

The following works within my code:-
Call CommandButton10_Click
where CB10 is one of many on a Userform
and CommandButton10_Click is a subroutine "on" the Userform.

The problem comes when I try to make the CommandButton10 part a variable.
My code will produce a value for the variable "MyCommandButton" which might
be CommandButton15 for example.
Then I try to make the call as follows:-
Call MyCommandButton(&"_Click")
a compile error "Expected Sub, Function or Property" results.

Is this just my bad syntax, or am I trying to do something which VBA doesn't
like?
donwb


 
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 a subroutine using variable subroutine name dhstein Excel Discussion (Misc queries) 3 July 26th 09 08:28 PM
How To Quit Subroutine from a called subroutine Rich J[_2_] Excel Programming 5 February 20th 07 06:48 PM
Call subroutine from another workbook DejaVu[_55_] Excel Programming 2 November 3rd 05 04:12 PM
Call Subx for excel 97 Add-In subroutine Dave D-C[_3_] Excel Programming 4 March 2nd 05 08:05 PM
Subroutine call without file reference jaf Excel Programming 0 August 25th 03 05:52 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"