最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
EXCEL下使用MATCH函数碰到的问题
时间:2022-07-02 11:31:10 编辑:袖梨 来源:一聚教程网
Sub USEMATCH()
Dim s_p As String, e_p As String
Dim num As Integer
num = 0
For Each M In Range("a:a")
If M.Value <> "" Then
num = num + 1
Else
Exit For
End If
Next M
erange = "b" & num
erange = "b2:" & erange
N = 1
a = 2
currange = "b" & a
Cells.Select
Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, Key2:=Range("B2") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom, SortMethod:=xlPinYin, DataOption1:= _
xlSortNormal, DataOption2:=xlSortNormal
Columns("A:A").Select
Selection.Insert Shift:=xlToRight '最左插入一列
Set curCell = Worksheets(Sheets(1).Name).Range(currange)
For Each M In Range(erange)
On Error GoTo ErrorHandler
If M.Offset(0, -1).Value <> "" Then GoTo mynext
Dim s_p As String, e_p As String
Dim num As Integer
num = 0
For Each M In Range("a:a")
If M.Value <> "" Then
num = num + 1
Else
Exit For
End If
Next M
erange = "b" & num
erange = "b2:" & erange
N = 1
a = 2
currange = "b" & a
Cells.Select
Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, Key2:=Range("B2") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom, SortMethod:=xlPinYin, DataOption1:= _
xlSortNormal, DataOption2:=xlSortNormal
Columns("A:A").Select
Selection.Insert Shift:=xlToRight '最左插入一列
Set curCell = Worksheets(Sheets(1).Name).Range(currange)
For Each M In Range(erange)
On Error GoTo ErrorHandler
If M.Offset(0, -1).Value <> "" Then GoTo mynext
相关文章
- 《弓箭传说2》新手玩法介绍 01-16
- 《地下城与勇士:起源》断桥烟雨多买多送活动内容一览 01-16
- 《差不多高手》醉拳龙技能特点分享 01-16
- 《鬼谷八荒》毕方尾羽解除限制道具推荐 01-16
- 《地下城与勇士:起源》阿拉德首次迎新春活动内容一览 01-16
- 《差不多高手》情圣技能特点分享 01-16