2016-03-19 11 views
0

Excelのコメントをオン/オフするためのvbaコードを探しています。オンラインヘルプに使用しています。Excelのコメントを有効または無効にするためにvbaコードを有効にする

Sub CommentsToggle_Click() 
    If Help.Caption = "HELP" Then 
    'If IsEmpty(Comments) = True Then 
     Application.DisplayCommentIndicator = xlCommentAndIndicator 
     Help.Caption = "HIDE COMMENTS" 
    Else 
     Application.DisplayCommentIndicator = xlCommentIndicatorOnly 
     ' Comments = 1 
    End If 
End Sub 
+0

を行う前に、トグルボタンの状態を確認する必要があり、その場合にはトグルボタンを、使用している表示されますその答えの横にあるチェックマークをクリックして答えを返します。あなたが聞いた質問でこれをやっていないことに気づきました。 – CaffeinatedCoder

答えて

0

としてそれをマークしてください、あなたは答えはあなたの問題を解決するのに役立ちます場合は何も

Sub CommentsToggle_Click() 
    If CommentsToggle.Value = True Then 'The toggle button is pressed 
     Application.DisplayCommentIndicator = xlCommentAndIndicator 
     Help.Caption = "HIDE COMMENTS" 
    Else 'The toggle button is depressed :(
     Application.DisplayCommentIndicator = xlCommentIndicatorOnly 
     Help.Caption = "HELP" 
    End If 
End Sub 
関連する問題