Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-26-2023, 10:52 AM
cavals07 cavals07 is offline Change Text Colour/Box Shade if CheckBox is marked Windows 10 Change Text Colour/Box Shade if CheckBox is marked Office 2010
Novice
Change Text Colour/Box Shade if CheckBox is marked
 
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Text Colour/Box Shade if CheckBox is marked Conditionally Colour/Shade Numeric Output Ranges E.Buttimer Mail Merge 1 03-25-2021 02:20 PM
Change text colour for content control labels? Toe Word 1 01-17-2019 08:45 AM
Change Text Colour in Cell Based on Text in Same Cell PMC11 Word VBA 1 11-14-2017 09:15 PM
Change Text Colour/Box Shade if CheckBox is marked Quickest way to change text to Arial size 11 specific colour BlueClearSky Word 6 11-22-2013 03:34 PM
How to change line height for marked text (in Word 2007)? ... as default for font? pstein Word 1 01-14-2012 10:15 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:09 AM.


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