Last active
February 28, 2016 18:10
-
-
Save bervukas/6952d2013c40f6a3272f to your computer and use it in GitHub Desktop.
Example: Data validation in VBA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Test(L1 As Long, L2 As Long, Optional P1 As Variant, Optional P2 As Variant) As String | |
Dim S As String | |
If IsMissing(P1) = True Then | |
S = "P1 Is Missing." | |
Else | |
S = "P1 Is Present (P1 = " & CStr(P1) & ")" | |
End If | |
If IsMissing(P2) = True Then | |
S = S & " " & "P2 Is Missing" | |
Else | |
S = S & " " & "P2 Is Present (P2 = " & CStr(P2) & ")" | |
End If | |
Test = S | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment