- 帖子
- 133
- 主題
- 9
- 精華
- 0
- 積分
- 147
- 點名
- 0
- 作業系統
- Win10
- 軟體版本
- Office 2010
- 閱讀權限
- 20
- 性別
- 男
- 來自
- 高雄
- 註冊時間
- 2010-5-1
- 最後登錄
- 2024-11-11
|
2#
發表於 2010-7-9 12:04
| 只看該作者
提供一個測試看看~放在 sheet 裡面,不要放在模組裡..
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim note As String
If Not ActiveCell = Empty Then
If Not ActiveCell.Comment Is Nothing Then
note = InputBox("請輸入當日記事", , ActiveCell.Comment.Text)
Else
note = InputBox("請輸入當日記事")
End If
If note = Empty Then
ActiveCell.ClearComments
ActiveCell.Font.ColorIndex = 0
Else
On Error Resume Next
ActiveCell.AddComment
ActiveCell.Comment.Text Text:=note
ActiveCell.Font.ColorIndex = 3
End If
End If
End Sub |
|