返回列表 上一主題 發帖

[發問] 萬年曆問題

提供一個測試看看~放在 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

TOP

還是可以請您寄一個範例給我看呢?


您好! 請參考附件.
sample.rar (7.69 KB)

TOP

        靜思自在 : 有多少力量就做多少事,不要心存等待,等待才會落空。
返回列表 上一主題