- 帖子
- 154
- 主題
- 1
- 精華
- 0
- 積分
- 200
- 點名
- 1
- 作業系統
- windwos 7
- 軟體版本
- 64bit
- 閱讀權限
- 20
- 註冊時間
- 2017-5-29
- 最後登錄
- 2025-1-1
|
2#
發表於 2024-8-15 07:22
| 只看該作者
回復 1# m06o2 - Sub test()
-
- Dim LastRow As Long
- Sheets("工作表2").Cells.Clear
- With Sheets("工作表1")
- LastRow = .Range("A1").CurrentRegion.Rows.Count
- rr = 1
- cc = 1
- For i = 1 To LastRow
- Sheets("工作表2").Cells(rr, cc) = .Cells(i, 1)
- If i = LastRow Then Exit For
- rr = rr + 1
- If Sgn(0 - .Cells(i, 1)) + Sgn(0 - .Cells(i + 1, 1)) = 0 Then
- aa = aa + 1
- If aa Mod 2 = 1 Then
- rr = 1
- cc = cc + 1
- End If
- End If
- Next i
- End With
- End Sub
複製代碼
|
|