有图解,你可以看看
新建一个模块,
Sub DeleteWord()
Dim strtemp As String, inttemp As String, r As Range
For Each r In Selection
strtemp = r
inttemp = ""
For i = 1 To Len(strtemp)
If IsNumeric(Mid(strtemp, i, 1)) Then
inttemp = inttemp & Mid(strtemp, i, 1)
End If
Next i
r = inttemp
Next r
End Sub
复制代码过去。
QQ:394901158
打开你的Excel宏编辑窗口
插入一个模块
在里边输入下列代码
Const sz As String = "0123456789"
Function findSZ(ByVal s As String) As String
Dim s1 As String
For i = 1 To Len(s)
s1 = Mid(s, i, 1)
If InStr(1, sz, s1) Then findSZ = findSZ + s1
Next
End Function
Public Function THZF()
Dim s As Worksheet
Set s = Application.ActiveSheet
dim i as long
For i = 1 To 100
s.Cells(i, 1) = findSZ(Cells(i, 1))
Next i
End Function
里面有向处需要根据你的实际情况改变一下
For i = 1 To 100
s.Cells(i, 1) = findSZ(Cells(i, 1))
Next i
中
1 To 100 后边的100改成你的实际行数
s.Cells(i, 1) = findSZ(Cells(i, 1))这里面的1改为你的实际列,列从1起
然后将光标移动到
Public Function THZF()
下一行,按下F5
已测试过
新建一个模块,
Sub DeleteWord()
Dim strtemp As String, inttemp As String, r As Range
For Each r In Selection
strtemp = r
inttemp = ""
For i = 1 To Len(strtemp)
If IsNumeric(Mid(strtemp, i, 1)) Then
inttemp = inttemp & Mid(strtemp, i, 1)
End If
Next i
r = inttemp
排个序,直接选上删掉不就行了啊。
简单鼠标操作即可解决
欲知其详 请点击 在线交谈