![]() |
|
#6
|
||||
|
||||
|
As coded, the macro in the link is for just a single table cell. To work with multiple dropdowns, you could use code like:
Code:
Dim lTbl As Long, lRow As Long, lCol As Long, lClr As Long Const StrPwd As String = "" Sub ConditionalFormat() With ActiveDocument If .ProtectionType = wdAllowOnlyFormFields Then .Unprotect , StrPwd .Tables(lTbl).Cell(lRow, lCol).Range.Shading.BackgroundPatternColor = lClr .Protect wdAllowOnlyFormFields, True, NoReset:=True, Password:=StrPwd End With End Sub Code:
Sub DD1Fmt()
With ActiveDocument.FormFields("Dropdown1")
lTbl = ActiveDocument.Range(0, .Range.End).Tables.Count
lRow = .Range.Cells(1).RowIndex
lCol = .Range.Cells(1).ColumnIndex
Select Case .Result
Case "Unknown": lClr = wdColorPink
Case "Yes": lClr = wdColorLightBlue
Case "No": lClr = wdColorBrightGreen
Case Else: lClr = wdColorYellow
End Select
Call ConditionalFormat
End With
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Macro to keep formatted form fields after mail merge or replace text with formatted form fields | jer85 | Word VBA | 2 | 04-05-2015 10:00 PM |
Reinstalling Office 2013 after factory reset
|
barryd | Office | 1 | 05-17-2013 04:24 PM |
| Form Fields in Word | jwm1346 | Word | 1 | 04-17-2012 07:02 PM |
Preventing Form Fields to Reset
|
PosseJohn | Word VBA | 4 | 07-15-2011 09:44 PM |
| Form fields in Word messed up | mba | Word VBA | 0 | 02-07-2010 09:54 PM |