返回列表 上一主題 發帖

[發問] 在一筆資料裡面 去掉0 & 空格 然後重新排序

Sub 排序()
With Range([B2], Cells(Rows.Count, 2).End(xlUp))
     .Replace "0", "", Lookat:=xlWhole
     .Sort key1:=.Item(1), order1:=xlAscending, Header:=xlNo
End With
End Sub

TOP

回復 3# bomber1224

Lookat:=xlWhole  完全比對

102
0
2300

只會將0取代為空, 102及2300中的0不取代

Lookat:=xlPart  部份比對
102 >> 12
0 >> 空白
2300 >> 23

TOP

        靜思自在 : 君子為目標,小人為目的。
返回列表 上一主題