Anonymous Anonymous - 8 months ago
2673 0

Select Case Example LineStyle

Other

Select Case Example LineStyle

Option Explicit

Sub SelectCaseExample()
    Dim strInput As String
    strInput = "xlDashDotDot"
    
    Dim nConstVal As Integer
    
    Select Case strInput
    
        Case "xlContinuous"
            nConstVal = xlContinuous
            
        Case "xlDash"
            nConstVal = xlDash
            
        Case "xlDashDot"
            nConstVal = xlDashDot
            
        Case "xlDashDotDot"
            nConstVal = xlDashDotDot
        
        Case "xlDot"
            nConstVal = xlDot
        
        Case "xlDouble"
            nConstVal = xlDouble
        
        Case "xlLineStyleNone"
            nConstVal = xlLineStyleNone
        
        Case "xlSlantDashDot"
            nConstVal = xlSlantDashDot
            
    End Select
    
    MsgBox strInput & " -> " & nConstVal
End Sub
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download