View Single Post
 
Old 09-29-2013, 09:57 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

Hi Jenn,

Try something based on:
Code:
Sub ColorIt()
Dim i As Long, R As Long, G As Long, B As Long, Rng As Range
With ActiveDocument.Tables(1)
  For i = 2 To .Rows.Count
    Set Rng = .Cell(i, 1).Range
    Rng.End = Rng.End - 1
    R = CLng(Rng.Text)
    Set Rng = .Cell(i, 2).Range
    Rng.End = Rng.End - 1
    G = CLng(Rng.Text)
    Set Rng = .Cell(i, 3).Range
    Rng.End = Rng.End - 1
    B = CLng(Rng.Text)
    .Cell(i, 4).Shading.BackgroundPatternColor = RGB(R, G, B)
    .Cell(i, 5).Shading.BackgroundPatternColor = RGB(R, G, B)
  Next i
End With
End Sub
PS: Sepia is actually 112, 66, 20
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote