下面一起来看看excel如何提取九裂志责字符串中不规则位置的数字 。
![excel如何提取字符串中不规则位置的数字](http://imgit.jingyanla.com/240308/0306021L2-0.png)
方法
首先打开要进行操作的Excel表格 。![excel如何提取字符串中不规则位置的数字](http://imgit.jingyanla.com/240308/03060263S-1.png)
打开用鼠标右键单击下方的Sheet1 。
![excel如何提取字符串中不规则位置的数字](http://imgit.jingyanla.com/240308/0306021001-2.png)
在弹出的对话框中点击查看代码 。
![excel如何提取字符串中不规则位置的数字](http://imgit.jingyanla.com/240308/030602L30-3.png)
然后在弹出的窗口中点击插入 。
![excel如何提取字符串中不规则位置的数字](http://imgit.jingyanla.com/240308/030602Cb-4.png)
在弹出的对话框中点击模块 。
![excel如何提取字符串中不规则位置的数字](http://imgit.jingyanla.com/240308/0306024552-5.png)
然后在插入的模块界面中输入以下代码:
Function A(x As Range)For i = 1 To Len(x)If Mid(x, i, 1) >= 0 And Mid(x, i, 1) <= 9 ThenA = A & Mid(x, i, 1)End IfNext iA = –AEnd Function
![excel如何提取字符串中不规则位置的数字](http://imgit.jingyanla.com/240308/0306022950-6.png)
然后回到Excel , 选中要提取数字的单元格 。
![excel如何提取字符串中不规则位置的数字](http://imgit.jingyanla.com/240308/0306022233-7.png)
在选中的单元格中输入公式:=A(A1),输入完成后点击回车键 。
![excel如何提取字符串中不规则位置的数字](http://imgit.jingyanla.com/240308/0306021V1-8.png)
然后用鼠标左键按住右下角的填充柄 。
![excel如何提取字符串中不规则位置的数字](http://imgit.jingyanla.com/240308/03060263b-9.png)
按住填充柄往下拉,直到最后一个数据,这样就完成了提取字符串中不规则位置的数字 。
【excel如何提取字符串中不规则位置的数字】
![excel如何提取字符串中不规则位置的数字](http://imgit.jingyanla.com/240308/0306023T5-10.png)