返回列表 上一主題 發帖

[發問] 萬年曆問題

[發問] 萬年曆問題

S   M   T   W   T   F   S
        1   2    3   4   5   6
   7   8   9   10  11 12 13
  14 15 16  17  18 19 20
  21 22 23  24  25 26 27
  28 29 30  31


上面是萬年曆的樣子

我想做到可以記事的功能

例如說我在1日的地方記事,就直接在1日的上面點一下,可以出現一個能輸入的訊息框

,輸入完成後,1日那天的樣式會變(變嚴顏色或字體變粗)來顯示那天有記事情,下次我

直接在上面點一下,就可以顯示我當天所記的事情 ,有點像是手機的行日曆功能。



不知道VBA是否能寫出像這樣的功能??

請會的人幫我解答一下好嗎?

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

本帖最後由 Hsieh 於 2010-7-9 15:51 編輯

回復 4# jackdream


  不好意思, 可否麻煩您寄到我信箱,因為我的權限還不夠,無法使用檢視附檔
   感謝您的幫忙!!
請詳閱版規第12條
http://forum.twbts.com/viewthrea ... amp;extra=page%3D1;

TOP

回復 1# shadowming


     精美日曆,兩百年
      黃飛鴻家鄉人的作品吧?

精美日历.rar (602.53 KB)

TOP

回復 5# chamonix

抱歉  無法下載您提供的答案
能否麻煩寄到我GOOGLE信箱

TOP

回復 6# shadowming

Please write me jinhuiok@gmail.com for this attachement

TOP

回復 6# shadowming


   Already sent the attachement  you wanted to your GMail box, and check it
趵突泉上映明月,太行山谷迎朝阳

TOP

        靜思自在 : 待人退一步,愛人寬一寸,就會活得很快樂。
返回列表 上一主題