RAJAQ
11/30/2016 - 4:00 PM

Nested Select Case > can be used to decide on various variables

Nested Select Case > can be used to decide on various variables

Option Explicit
Dim Msg As String

Sub CheckCell()

    Select Case IsEmpty(ActiveCell)
        Case True
        Msg = "is blank"
        Case Else
            Select Case ActiveCell.HasFormula
                Case True
                Msg = "has a formula"
                Case Else
                    Select Case IsNumeric(ActiveCell)
                        Case True
                        Msg = "has a number"
                        Case Else
                            Msg = "has text"
                    End Select
            End Select
        End Select
        
    MsgBox "Cell " & ActiveCell.Address & " " & Msg

End Sub