我建立了一個公式,從另一組數字中吐出一個帶有數字的電子郵件地址。例如,我有數千種以下型別的字串:
[email protected]
公式后的結果:[email protected]
我的完美作業的Excel公式是: =RIGHT($A$6,LEN($A$6) LEN(LEFT(A$6$, (MATCH(TRUE,ISERROR(VALUE(MID($A$6,ROW(INDIRECT("1 :"&LEN($A$6))),1))),0))-1)))。特別說明了我如何處理 VALUE(將其更改為 VAL)和 INDERECT 函式(括在其 calc [ xxx ] 中,但是,這是我認為應該作業的損壞的用戶函式;它只是不起作用。
Function Test(Cell_Addrs As Range)
NewString = Right(Cell_Addrs, Len(Cell_Addrs) - Len(Left(Cell_Addrs, _
(Application.WorksheetFunction.Match _
(True, IsError(Val(Mid(Add_Rss, Application.WorksheetFunction.Row _
([INDIRECT("1:" & Len(Cell_Addrs))]), 1))), 0)) _
- 1)))
Test = NewString
End Function
uj5u.com熱心網友回復:
使用Val()函式獲取前面的數字并將其替換為空字串。
Val 函式在它無法識別為數字的一部分的第一個字符處停止讀取字串。
Public Function ToEmail(rng As Range) As String
ToEmail = Replace(rng.Value, Val(rng.Value), vbNullString)
End Function
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/433516.html
