- 帖子
- 62
- 主題
- 13
- 精華
- 0
- 積分
- 109
- 點名
- 0
- 作業系統
- Win 10家用版
- 軟體版本
- Office 2013
- 閱讀權限
- 20
- 性別
- 女
- 來自
- 新北
- 註冊時間
- 2016-1-27
- 最後登錄
- 2024-8-12
|
3#
發表於 2016-5-10 08:23
| 只看該作者
回復 2# jackyq
在工作表中:
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Mail_Range
End Sub
在Module1中:- Sub Mail_Range()
- Dim Source As Range
-
- Set Source = Nothing
- On Error Resume Next
-
- '新增程式碼開始,作用中儲存格停在哪個部門別,就設定為Source
-
- If ActiveCell = Cells(3, 2) Then
- Set Source = Range("A1:J26").SpecialCells(xlCellTypeVisible)
- ElseIf ActiveCell = Cells(3, 13) Then
- Set Source = Range("L1:U26").SpecialCells(xlCellTypeVisible)
- ElseIf ActiveCell = Cells(30, 2) Then
- Set Source = Range("A28:J52").SpecialCells(xlCellTypeVisible)
- ElseIf ActiveCell = Cells(30, 13) Then
- Set Source = Range("L28:U52").SpecialCells(xlCellTypeVisible)
- Else
- End If
-
-
- On Error GoTo 0
-
- Source.Copy
-
- '將此範圍複製到指定的範圍或複製到剪貼簿中
- End Sub
複製代碼 但是視窗到新郵件時,按滑鼠右鍵->貼上,
沒有資料耶,
是不是Module1程式碼哪裡有誤?
而導致沒有複製到剪貼簿中呢?
謝謝 |
|