![]() |
|
#2
|
||||
|
||||
|
Your code is non-functioning. If I correct the missing line to allow it to work we can also allow two options for Str or Strong
Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
With ContentControl
Select Case .Title
Case "CE"
Select Case .Range.Text
Case "Strong", "Str": .Range.Cells(1).Shading.BackgroundPatternColor = 6299648: .Range.Cells(1).Range.Font.ColorIndex = wdWhite
Case "Weak": .Range.Cells(1).Shading.BackgroundPatternColor = 4739264: .Range.Cells(1).Range.Font.ColorIndex = wdWhite
Case "Sat": .Range.Cells(1).Shading.BackgroundPatternColor = 5880731: .Range.Cells(1).Range.Font.ColorIndex = wdBlack
Case "IN": .Range.Cells(1).Shading.BackgroundPatternColor = 5232127: .Range.Cells(1).Range.Font.ColorIndex = wdBlack
Case Else: .Range.Cells(1).Shading.BackgroundPatternColorIndex = wdNoHighlight
End Select
End Select
End With
End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Excel 2003: VBA "Function" causes "#VALUE!" errors after running "insert/delete row" custom macro | Matt C | Excel Programming | 2 | 01-08-2022 06:03 AM |
| Unable to customize ribbon, remove "Cell Styles" | pjs15 | Excel | 1 | 08-21-2020 08:01 AM |
When applying styles word is automatically reverting to "strong" style partway through my document
|
Victoria S | Word | 3 | 11-17-2015 12:51 PM |
| Message "Unable to read file" when clicking on the Excel icon | roundman | Excel | 3 | 12-03-2014 04:28 PM |
| Unable to "Shift cells down" on unprotected area in a protected worksheet | ricky0309 | Excel | 0 | 08-14-2014 01:51 AM |