View Single Post
 
Old 09-22-2015, 10:13 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,225
macropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant future
Default

Try something along the lines of:
Code:
Sub FormatColumns()
Dim i As Long, StrCols As String
If Selection.Information(wdWithInTable) = False Then Exit Sub
StrCols = InputBox("Please input the column #s to process." & vbCr & "(e.g. 1,2,3,5)")
On Error Resume Next
With Selection.Tables(1)
  If .Uniform = False Then Exit Sub
  For i = 0 To UBound(Split(StrCols, ","))
    With .Columns(Trim(Split(StrCols, ",")(i)))
      .Borders(wdBorderLeft).ColorIndex = wdWhite
      .Borders(wdBorderRight).ColorIndex = wdWhite
      .Borders(wdBorderTop).ColorIndex = wdWhite
      .Borders(wdBorderBottom).ColorIndex = wdWhite
      .Borders(wdBorderHorizontal).ColorIndex = wdWhite
    End With
  Next
End With
End Sub
As coded, the macro will process any single selected table, provided it doesn't have merged columns.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote