View Single Post
 
Old 01-26-2023, 10:52 AM
cavals07 cavals07 is offline Windows 10 Office 2010
Novice
 
Join Date: Jan 2023
Posts: 5
cavals07 is on a distinguished road
Default Change Text Colour/Box Shade if CheckBox is marked

Hi all!

Thanks for welcoming me into this community. I am a basic VBA user (very beginner!) and hoping you may be able to help me out.

I've been trying (embarassingly for hours) to create a VBA code that changes the text colour/check box colour/background shading to RED if the 'AWAITING RESPONSE' is checked, and to GREEN if the 'RESPONSE RECEIVED' is checked.

I have attached a sample doc

This is what I currently have:

Private Sub Module1_ContentControlOnEnter(ByVal ContentControl As ContentControl, Cancel As Boolean)

If (ContentControl.Title = "Awaiting Response" And ContentControl.Checked = True) Then
ContentControl.Range.Font.ColorIndex = wdRed
End If
If (ContentControl.Title = "Awaiting Response" And ContentControl.Checked = False) Then
ContentControl.Range.Font.ColorIndex = wdGreen
End If
End Sub


Any help would be super appreciated!!
Attached Files
File Type: docx CHECKBOX.docx (22.8 KB, 18 views)
Reply With Quote