View Single Post
 
Old 06-19-2016, 07:42 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,366
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Word has no offset function. Instead, in Word you could use code like:
Code:
Private Sub CheckBox1_Click()
Call ShadeCell(CheckBox1.Value)
End Sub
 
Sub ShadeCell(bVal As Boolean)
Application.ScreenUpdating = False
With Selection.Cells(1).Previous.Shading
  .BackgroundPatternColor = wdColorAutomatic
  If bVal = True Then
    .BackgroundPatternColor = wdColorYellow
  Else
    .BackgroundPatternColor = wdColorAutomatic
  End If
End With
Application.ScreenUpdating = True
End Sub
with each checkbox calling the ShadeCell macro as demonstrated above. Exactly why the code needs to call '.BackgroundPatternColor = wdColorAutomatic' before testing bVal isn't clear but, on my system, it only seems to shade the active cell without it.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote