#1
|
|||
|
|||
VBA to show/hide checkboxes- always showing bookmark
Hello-
I have a VBA code to show a bookmark based on the checkbox being selected, however, every time I load the word template all of the bookmarks under one section are showing unless I select/unselect them before I get started on filling out the document. The checkboxes are in a straight line across my word document. There are times where 1 option is selected and other times where all could be selected. My VBA code is Private Sub CheckBox6_Click() ActiveDocument.Bookmarks("LT").Range.Font.Hidden = Not CheckBox6.Value End Sub Private Sub CheckBox9_Click() ActiveDocument.Bookmarks("MT").Range.Font.Hidden = Not CheckBox9.Value End Sub Private Sub CheckBox10_Click() ActiveDocument.Bookmarks("HT").Range.Font.Hidden = Not CheckBox10.Value End Sub Private Sub CheckBox11_Click() ActiveDocument.Bookmarks("XHT").Range.Font.Hidden = Not CheckBox11.Value End Sub Private Sub CheckBox12_Click() ActiveDocument.Bookmarks("XHTT").Range.Font.Hidden = Not CheckBox12.Value End Sub Private Sub CheckBox13_Click() ActiveDocument.Bookmarks("PP").Range.Font.Hidden = Not CheckBox13.Value End Sub Private Sub CheckBox14_Click() ActiveDocument.Bookmarks("T").Range.Font.Hidden = Not CheckBox14.Value End Sub What am I doing wrong? |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UserForm with checkboxes that hide/show bookmarked text in document | dohertym | Word VBA | 4 | 05-16-2022 09:48 PM |
Checkbox - toggle hide/unhide other checkboxes and their texts | Basse | Word VBA | 2 | 05-11-2022 10:43 PM |
Hide one bookmark when Two checkboxes are checked | AVarg123 | Word VBA | 4 | 04-01-2022 06:21 PM |
REf Fields show Bookmark whole cell when Bookmark is created by code. | pmcpowell | Word VBA | 2 | 11-16-2019 07:05 PM |
Bookmark will not show/hide based on CC Checkbox | lord_kaiser | Word VBA | 1 | 04-17-2018 01:19 AM |