ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   using Switch() to call functions (https://www.excelbanter.com/excel-programming/298488-using-switch-call-functions.html)

majikman[_21_]

using Switch() to call functions
 
I have different code modules i've created and they are to be ru
depending on the user that is logged in. I would prefer to use th
Switch() statement instead of a series of If..Then..Else statements
Problem is, i'm not sure how to do it since the definition of Switch(
seems to have to return something. I'm more familiar with C++ and I'
like to be able to use the VBA Switch much like I could with the C+
switch. If anyone can point me to some information or give me a
example, I would greatly appreciate that. Thanks

--
Message posted from http://www.ExcelForum.com


SunTzuComm

using Switch() to call functions
 
Try the "Select Case" statement. That's VBA's equivalent of Java's Switch()
statement, so it's probably the same as the Switch() statement in C++, too.

Regards,
Wes


All times are GMT +1. The time now is 04:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com