Hi Guys,
I am new to VBA and have managed to get this far using books and help files on the internet. I would like to know if it is possible to amend the code to allow this to work on multiple checkboxes, if it is possible could somebody please show me how? i.e. if i click on checkbox1 it shows the text, if i click on checkbox 2 it shows the text. I managed to amend a little but when I click on any checkbox it shows all the text and not just the text for the checbox that was ticked.
I am new to VBA and have managed to get this far using books and help files on the internet. I would like to know if it is possible to amend the code to allow this to work on multiple checkboxes, if it is possible could somebody please show me how? i.e. if i click on checkbox1 it shows the text, if i click on checkbox 2 it shows the text. I managed to amend a little but when I click on any checkbox it shows all the text and not just the text for the checbox that was ticked.
Code:
Sub CheckBox1_Change()
Call ShowHideBookmark
End Sub
Sub ShowHideBookmark()
Dim orange As Range
Set orange = ActiveDocument.Bookmarks("Bookmarkname").Range
If CheckBox1.Value = True Then
With orange.Font
.Hidden = True
End With
With ActiveWindow.View
.ShowHiddenText = False
.ShowAll = False
End With
Else
With orange.Font
.Hidden = False
End With
With ActiveWindow.View
.ShowHiddenText = True
.ShowAll = False
End With
End If
End Sub