Use string text value as the compiler directive : Compiler Directive « Language Basics « VBA / Excel / Access / Word






Use string text value as the compiler directive

 
#Const Language = "Spanish"

Sub cmdConditionalCompilation_Click()
   #If Language = "Spanish" Then
      msgBox "Hola, Que Tal?"
   #Else
      msgBox "Hello, How Are You?"
   #End If
End Sub

 








Related examples in the same category

1.With the compiler directive
2.Use #If
3.Use #Const to define the constant