Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 12-05-2016, 04:19 PM
gmaxey gmaxey is offline How to change font and background colors based on Combo Box selection Windows 7 32bit How to change font and background colors based on Combo Box selection Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

If it is a content control you have to use the OnExit event in the ThisDocument module;

Code:
Private Sub Document_ContentControlOnExit(ByVal CC As ContentControl, Cancel As Boolean)
  Select Case CC.Range.Text
    Case "Critical"
      CC.Range.Shading.BackgroundPatternColorIndex = wdRed
      CC.Range.Font.ColorIndex = wdWhite
    Case "Medium"
      CC.Range.Shading.BackgroundPatternColorIndex = wdYellow
      CC.Range.Font.ColorIndex = wdBlack
    Case "Low"
     CC.Range.Shading.BackgroundPatternColorIndex = wdGreen
     CC.Range.Font.ColorIndex = wdWhite
  End Select
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change font and background colors based on Combo Box selection Change Background Colors in Office 2013 boward57 Office 2 10-06-2015 06:53 PM
text based on Combo box selection rosscortb Word VBA 3 03-16-2015 06:57 PM
Combo Box Content Control Calculate on selection help ciresuark Word 0 03-06-2015 01:49 PM
How to change font and background colors based on Combo Box selection Unable to change font colors from theme colors choy Word 3 08-01-2012 09:12 PM
How can I change the colors of cells automatically based on Job Completion? Learner7 Excel 0 07-06-2010 10:47 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:32 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