- 帖子
- 5923
- 主題
- 13
- 精華
- 1
- 積分
- 5986
- 點名
- 0
- 作業系統
- win10
- 軟體版本
- Office 2010
- 閱讀權限
- 150
- 性別
- 男
- 來自
- 台灣基隆
- 註冊時間
- 2010-5-1
- 最後登錄
- 2022-1-23
        
|
4#
發表於 2010-6-26 18:02
| 只看該作者
本帖最後由 GBKEE 於 2010-6-26 19:59 編輯
回復 3# myleoyes
Leov11 是連續的範圍 Leov11-1 中間有隱藏的範圍是不同的- Sub Ex()
- Dim R, A, C, Rng As Range, II%
- If ActiveCell.Column >= 3 And ActiveCell.Column <= 15 Then
- If ActiveCell.Column Mod 2 > 0 Then
- R = (ActiveCell.Row - 5) Mod 12
- If R >= 0 And R <= 11 Then
- ActiveCell.Copy Cells(2, ActiveCell.Column)
- Application.EnableEvents = False
- Set Rng = ActiveCell.EntireColumn.SpecialCells(xlCellTypeVisible)
- For Each C In Rng.Areas
- For Each A In C.Cells
- If A.Row = ActiveCell.Row Then II = 1
- If II > 0 Then II = II + 1
- If II = 14 Then
- Cells(2, ActiveCell.Column + 1) = ActiveCell.Offset(, 1) - A.Offset(, 1)
- Application.EnableEvents = True
- Exit Sub
- End If
- Next
- Next
- End If
- End If
- End If
- End Sub
複製代碼 |
|