Sub ttt()
Dim sRange As Range, r As Range
Dim s$, a, i%
Set sRange = Selection
If sRange.Cells.Count = 1 Then
MsgBox "请选择查找范围!"
Exit Sub
End If
s = InputBox("请输入数字区间(格式:80-90):")
a = Split(s, "-")
n1 = CInt(Trim(a(0)))
n2 = CInt(Trim(a(1)))
s = ""
For i = n1 To n2
s = s & "," & i
Next
For Each r In sRange
s = Replace(s, "," & r, "")
Next
a = Split(s, ",")
Set r = sRange.Cells(1, 1).Offset(-2, 0)
For i = 1 To UBound(a)
r = a(i)
Set r = r.Offset(-1, 0)
Next
End Sub
你这个需要写一个VBA程序,不过看你这个要求应该是要处理挺多的东西吧,需要参数可改的那种?
范围怎么处理,输入么?