Search notes:

VBA function: switch

option explicit

sub main()

    dim num as long
    num = 4

    debug.print (switch (        _
        num = 1, "one"      ,    _
        num = 2, "two"      ,    _
        num = 3, "three"    ,    _
        num = 4, "four"     ,    _
        num = 5, "five"     ,    _
        num = 6, "six"      ,    _
        num = 7, "seven"    ,    _
        num = 8, "eight"    ,    _
        num = 9, "nine"     ,    _
        num > 9, "too large")    _
    )

end sub
Github repository about-VBA, path: /functions/switch.bas

See also

The select statement and the choose function.
functions

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758193902, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/VBA/functions/switch(61): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78