需要程式設計按ALT+F11,插入-模組,複製下列語句FunctionSplitNumEng(str As String, sty As Byte) Dim StrA As String Dim StrB As String Dim StrC As String Dim i As Integer Dim SigS As String For i = 1 To Len(str) SigS = Mid(str, i, 1) If SigS Like "[a-zA-Z]" Then StrA = StrA & SigS ElseIf SigS Like "#" Then StrB = StrB & SigS Else StrC = StrC & SigS End If Next i Select Case sty Case 1 SplitNumEng = StrA Case 2 SplitNumEng = StrB Case Else SplitNumEng = StrC End SelectEndFunctionD2輸入 =SplitNumEng(C2,3) 下拉公式
需要程式設計按ALT+F11,插入-模組,複製下列語句FunctionSplitNumEng(str As String, sty As Byte) Dim StrA As String Dim StrB As String Dim StrC As String Dim i As Integer Dim SigS As String For i = 1 To Len(str) SigS = Mid(str, i, 1) If SigS Like "[a-zA-Z]" Then StrA = StrA & SigS ElseIf SigS Like "#" Then StrB = StrB & SigS Else StrC = StrC & SigS End If Next i Select Case sty Case 1 SplitNumEng = StrA Case 2 SplitNumEng = StrB Case Else SplitNumEng = StrC End SelectEndFunctionD2輸入 =SplitNumEng(C2,3) 下拉公式