- 帖子
- 5923
- 主題
- 13
- 精華
- 1
- 積分
- 5986
- 點名
- 0
- 作業系統
- win10
- 軟體版本
- Office 2010
- 閱讀權限
- 150
- 性別
- 男
- 來自
- 台灣基隆
- 註冊時間
- 2010-5-1
- 最後登錄
- 2022-1-23
|
8#
發表於 2011-5-27 09:33
| 只看該作者
本帖最後由 GBKEE 於 2011-5-27 09:35 編輯
回復 6# 棋語鳥鳴
不太了解你的意思 試看看
全部複製- Private Sub Worksheet_SelectionChange(ByVal Target As Range)
- Dim Rng As Range
- Set Rng = [A2:A12]
- If Not Application.Intersect(Rng, Target(1)) Is Nothing Then
- With Sheets("總表").Cells(Rows.Count, "A").End(xlUp).Offset(1)
- .Cells(1).Resize(Rng.Rows.Count) = Rng.Value
- .Cells(1, 2).Resize(Rng.Rows.Count, 3) = Range("R2").Resize(, 3).Value
- End With
- End If
- End Sub
複製代碼 複製 選擇處到底部- Private Sub Worksheet_SelectionChange(ByVal Target As Range)
- Dim Rng As Range
- Set Rng = [A2:A12]
- If Not Application.Intersect(Rng, Target(1)) Is Nothing Then
- For i = Target(1).Row To Rng.End(xlDown).Row
- With Sheets("總表").Cells(Rows.Count, "A").End(xlUp).Offset(1)
- .Cells(1) = Cells(i, Target(1).Column)
- .Cells(1, 2).Resize(, 3) = Range("R2").Resize(, 3).Value
- End With
- Next
- End If
- End Sub
複製代碼 |
|