Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If a string variable "ProductName" can have one of 10 values assigned
to it, is it possible to call a subroutine whose name is the same as the value of the variable?? If so, can you supply an example please. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Alan,
Not that I'm aware of, but you could pass the variable instead?........ Sub FirstProcedure() Dim ProductName As String Call ProcessingProcedure(ProductName) End Sub Sub ProcessingProcedure(ByVal ProductName As String) Select Case ProductName Case "Cat" 'Code here Case "Dog" 'Code here Case "Mouse" 'Code here Case Else 'Code here End Select End Sub Hope that helps Best regards John "Alan" wrote in message ups.com... If a string variable "ProductName" can have one of 10 values assigned to it, is it possible to call a subroutine whose name is the same as the value of the variable?? If so, can you supply an example please. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Application.Run ProductName
-- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Alan" wrote in message ups.com... If a string variable "ProductName" can have one of 10 values assigned to it, is it possible to call a subroutine whose name is the same as the value of the variable?? If so, can you supply an example please. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks guys.
Bob Phillips wrote: Application.Run ProductName -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Alan" wrote in message ups.com... If a string variable "ProductName" can have one of 10 values assigned to it, is it possible to call a subroutine whose name is the same as the value of the variable?? If so, can you supply an example please. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Assign value to a variable name | Excel Discussion (Misc queries) | |||
Assign value to variable | Excel Discussion (Misc queries) | |||
Variable VB to assign new sheet name | Excel Worksheet Functions | |||
assign variable | Excel Programming | |||
Assign Formula to Variable | Excel Programming |