Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #9  
Old 08-20-2019, 03:01 PM
GDaddy35803 GDaddy35803 is offline Conditionally Color Formatting Text selected from a dropdown list in Word 2010 Windows 10 Conditionally Color Formatting Text selected from a dropdown list in Word 2010 Office 2019
Novice
 
Join Date: Aug 2019
Posts: 1
GDaddy35803 is on a distinguished road
Default Need help with colorcoding a drop down list

Hello Paul,

I tried to do as you instructed but can't seem to see the code in your attachment.

I am not a coder, but this is what I am looking to do: make a drop down list in Word [done] but when I pick a word "Critical, High, Medium, Low, None" I want it displayed in the colors below. When I run the below VBScript they all display green. I copied this code off the internet and it change the whole cell one of the colors, but I just want the text. So what does the last line need to be as well?

Code:
With ContentControl.Range
    If ContentControl.Title = "Severity" Then
        Select Case .Text
            Case "Critical"
                .Attributes.Add("style", "color:Dark Red")
            Case "High"
                .Attributes.Add("style", "color:Red")
            Case "Medium"
                .Attributes.Add("style", "color:Orange")
            Case "Low"
                .Attributes.Add("style", "color:Blue")
            Case "None"
                .Attributes.Add("style", "color:Green")
            Case Else
                .Cells(1).Shading.BackgroundPatternColor = wdColorAutomatic
        End Select
    End If
End With
End Sub
Reply With Quote
 

Tags
conditional formatting, drop down lists, word 2010



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA: How to place dropdown list next to text YigalB Word VBA 0 08-11-2013 01:48 PM
Conditionally Color Formatting Text selected from a dropdown list in Word 2010 Formatting affecting more than selected text esteban Word 7 05-25-2012 04:34 AM
Change cell color everytime a value is selected in dropdown list angelica_gloria Excel 4 01-27-2012 06:47 PM
Conditionally Color Formatting Text selected from a dropdown list in Word 2010 Strange formatting text color error in form fields.. rscafidi Word 2 10-16-2011 03:25 PM
Text form field loses formatting in Word 2010 mel72349 Word 0 08-02-2011 02:25 PM

Other Forums: Access Forums

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