excel怎么取单元格中的数字数值excel办公/数码 -电脑资料

电脑资料 时间:2019-01-01 我要投稿
【www.unjs.com - 电脑资料】

    提取Excel单元格中的数字,这个问题在网络上常常有人问道,Excel貌似没有自带的公式可以解决,那么,我们只能通过Vba进行自定义公式的扩展了,代码如下:

    公式编程方法

代码如下复制代码

    Function GetNumber(IsStr As String) As String

    Dim I As Integer

    Dim Char As String

    For I = 1 To Len(IsStr)

    Char = Mid(IsStr, I, 1)

    If Char Like "[0-9]" Then GetNumber = GetNumber & Char

    Next

    End Function

    公式法

    1、数字在前,

excel怎么取单元格中的数字数值excel办公/数码

电脑资料

excel怎么取单元格中的数字数值excel办公/数码》(https://www.unjs.com)。

代码如下复制代码

    =LOOKUP(9^9,--LEFT(C6,ROW(1:9)))

    2、数字在后

代码如下复制代码

    =MID(C5,MIN(FIND(ROW(1:10)-1,C5&"0123456789")),9)

    3 数字在中间

代码如下复制代码

    =LOOKUP(9^9,--LEFT(MID(C7,MIN(FIND(ROW(1:10)-1,C7&"0123456789")),10),ROW(1:9)))

最新文章