How to check first character in a cell value

后端 未结 3 743
一向
一向 2021-01-29 06:30

I was wondering if there is a way to check the first character in a cell value.

E.g

01999102477490 ( first char \"0\" )

11003200602650 (first cha         


        
3条回答
  •  心在旅途
    2021-01-29 06:57

    Try:

    Option Explicit
    Sub FirstChar()
        Dim xlString As String
        Dim xlFirstChar As String
    
        xlString = "01999102477490"
    
        xlFirstChar = Left$(xlString, 1)
    
        MsgBox xlFirstChar
    End Sub
    

    String Manipulation

提交回复
热议问题