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: 2
Default Excel VBA code executing a variable as a Sub.

I have a If ....Else ....Then with code:

ElseIf szSelectedReport = "204" Then
RunReport204
ElseIf szSelectedReport = "205" Then
RunReport205
ElseIf szSelectedReport = "220" Then
RunReport220

This goes on for sometime and what I want to produce is a shortened
version i.e.

Dim szReport As String
szReport = CDbl(szSelectedReport)
szReport = "RunReport" & szReport
szReport

So the Sub is called RunReport222 and I have created that but I dont
know how to tell VB to now run that Sub.

Can anyone help me please.

Regards

John
 
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
QUERY & HELP: so slow executing VBA code... :S John Keith Excel Worksheet Functions 3 February 13th 06 03:47 PM
code sample for executing a VB function in Excel using perl newOLE Excel Worksheet Functions 7 August 10th 05 10:26 PM
Problems executing Excel VBA code in Microsoft Office 2003 Umesh Excel Programming 3 July 24th 03 12:45 AM
executing macros with variable names Claude Excel Programming 1 July 17th 03 05:19 PM
executing code when a module opens max Excel Programming 0 July 8th 03 07:37 PM


All times are GMT +1. The time now is 09:39 PM.

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"