![]() |
Assign Sub Name to a Variable
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. |
Assign Sub Name to a Variable
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. |
Assign Sub Name to a Variable
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. |
Assign Sub Name to a Variable
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. |
All times are GMT +1. The time now is 08:08 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com