Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-02-2023, 02:42 PM
KSmart KSmart is offline VBA to show/hide checkboxes- always showing bookmark Windows 10 VBA to show/hide checkboxes- always showing bookmark Office 2021
Novice
VBA to show/hide checkboxes- always showing bookmark
 
Join Date: Nov 2023
Posts: 3
KSmart is on a distinguished road
Default 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?
Reply With Quote
 



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

Other Forums: Access Forums

All times are GMT -7. The time now is 04:13 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft