VBA MOD01 Case statement

 Case statement 




Public Sub Simple_If()

Dim myText As String

myText = Range("B3").Value

Select Case myText

    Case 1 To 200

        Range("C3").Value = "Good"

    Case 0

        Range("C3").Value = ""

    Case Is > 200

        Range("C3").Value = "Excellent"

    Case Else

        Range("C3").Value = "Bad"

End Select


End Sub






Comments

Popular posts from this blog

VBA01 Copy Resize Variably Sized Ranges

VBA MOD01 Passing Arguments to sub procedures (ByRef , By Val)

PY MOD01 Lecture 01