返回列表 上一主題 發帖

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

回復 1# yueh0720
  1. Sub xx()
  2. Dim Ar()
  3. I = 0
  4. Columns("E") = ""
  5. For R = 2 To [C65536].End(xlUp).Row Step 3
  6.   ReDim Preserve Ar(I)
  7.   Ar(I) = Application.Sum(Left(Cells(R, 2), Len(Cells(R, 2)) - 1), Left(Cells(R, 3), Len(Cells(R, 3)) - 1))
  8.   I = I + 1
  9. Next R
  10. [E2].Resize(I, 1) = Application.Transpose(Ar)
  11. [E2].Resize(I, 1).Sort Key1:=[E2], Order1:=xlAscending, Header:=xlGuess
  12. [E2].Resize(I, 1).NumberFormatLocal = "0.00"
  13. End Sub
複製代碼

TOP

        靜思自在 : 一句溫暖的話,就像往別人身上灑香水,自己會沾到兩三滴。
返回列表 上一主題