- 最後登錄
- 2024-5-5
- 在線時間
- 7164 小時
- 註冊時間
- 2010-5-4
- 閱讀權限
- 95
- 精華
- 0
- UID
- 7964333
- 帖子
- 155
- 積分
- 1287 點
- 潛水值
- 47875 米
| 回覆中加入附件並不會使你增加積分,請使用主題方式發佈附件。 本帖最後由 tryit244178 於 2017-2-8 10:22 AM 編輯
首先加入這2個副程式- Private Sub CopyTransparentCell(ByVal seachRange As String)
- Dim i As Range
- Dim offestColumn As Integer
- Const Transparent As Long = 16777215
-
- For Each i In Sheet1.Range(seachRange)
- If i.Interior.Color = Transparent Then
- offestColumn = i.column - 1
- Sheet2.Cells(GetLastRow(offestColumn), offestColumn).value = Sheet1.Range("A" & i.Row).value
- End If
- Next i
- End Sub
- Private Function GetLastRow(ByVal column As Integer) As Integer
- GetLastRow = Sheet2.Cells(Sheet2.Cells.Rows.Count, column).End(xlUp).Row + 1
- End Function
複製代碼
然後在按鈕裡加入這行
- CopyTransparentCell "B2:C13"
複製代碼 ... |
|