View Single Post
 
Old 12-04-2013, 08:47 AM
BobBridges's Avatar
BobBridges BobBridges is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

Oh, I see. But his question (it seems to me) isn't about passing values to subroutines; it's about calling a variable subroutine. Sort of like this:
Code:
Select Case MyVar
  Case 1 To 7: SubName = "MySub_" & MyVar
  Case "Binge": SubName = "MaxTime"
  Case "Micro": SubName = "Micro"
  Case Else: SubName = ""
  End Select
If SubName <> "" Then Call SubName
That won't work, but what he's asking (I think) is how to do that sort of thing. If MyVar happens to be 5, then he wants his program to Call MySub_5; if it's "Binge" he wants to Call MaxTime; and so on.
Reply With Quote