Excel2000 VBA コメントの表示、非表示 [Excel2000 VBA独習]
Excel2000 VBA コメントの表示、非表示
マクロの記録でコメント欄を なし、コメントマークのみ 、コメントとコメントマークに切り替えて記録して実行したけど、想定した動作にならなかったので、下記のマクロを作成
Sub コメント表示非表示()
'
'表示しない、マークだけ、表示 に切り替える
'
If Application.DisplayCommentIndicator = xlNoIndicator Then Application.DisplayCommentIndicator = xlCommentIndicatorOnly: Exit Sub
If Application.DisplayCommentIndicator = xlCommentIndicatorOnly Then Application.DisplayCommentIndicator = xlCommentAndIndicator: Exit Sub
If Application.DisplayCommentIndicator = xlNoIndicator Then Application.DisplayCommentIndicator = xlNoIndicator Else Application.DisplayCommentIndicator = xlNoIndicator
End Sub
「Application.DisplayCommentIndicator」検索したら、下記のURLにマクロがあった
ttp://seadragon.info/excelvba/excel_library1_3.htm
自分が書いたマクロより、当然goodなのでこちらのマクロを採用(if じゃなくてSelect Caseを使うのだょ!)
Sub コメントを表示非表示()
'コメントを表示しない、マークだけ、表示、と切り替えます
Select Case Application.DisplayCommentIndicator
Case xlNoIndicator
Application.DisplayCommentIndicator = xlCommentIndicatorOnly
Case xlCommentIndicatorOnly
Application.DisplayCommentIndicator = xlCommentAndIndicator
Case xlCommentAndIndicator
Application.DisplayCommentIndicator = xlNoIndicator
Case Else
Application.DisplayCommentIndicator = xlNoIndicator
End Select
End Sub
再生できない場合、ダウンロードは🎥こちら
コメント欄の背景色を変える
- コメントのあるセルで右クリック「コメントの編集」をクリック
- 枠の部分を選択して右クリック、コメントの書式設定をクリック
- 塗りつぶし色で変更
コメント 0