返回列表 上一主題 發帖

請問該如何只將儲存格內數字部分相加並排序

本帖最後由 GBKEE 於 2012-5-3 17:52 編輯

回復 1# yueh0720
  1. Option Explicit
  2. Sub Ex()
  3.     With Sheets("TEST").Range("E2:E" & Sheets("TEST").Cells(Rows.Count, "A").End(xlUp).Row)
  4.         .Cells = ""
  5.         .Cells = "= MID(RC[-3],1,LEN(rC[-3])-1 ) + MID(RC[-2],1,LEN(rC[-2])-1 )"
  6.         .SpecialCells(xlCellTypeFormulas, xlErrors) = ""
  7.         .Value = .Value
  8.         .Cells.Sort Key1:=.Cells(1), Order1:=xlAscending, Header:=xlNo
  9.     End With
  10. End Sub
複製代碼

TOP

        靜思自在 : 甘願做、歡喜受。
返回列表 上一主題