Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 09-22-2015, 10:13 PM
macropod's Avatar
macropod macropod is offline VBA Word Table - Select More than 1 Column at a time - Apply Formatting Windows 7 64bit VBA Word Table - Select More than 1 Column at a time - Apply Formatting 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

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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Word Table - Select More than 1 Column at a time - Apply Formatting Table formatting- column widths to percent dherr Word VBA 3 05-02-2023 09:37 AM
Want a quotient using a constant to show up in column c each time a number is added to column b fibbermcghee Excel 2 12-09-2014 05:48 PM
VBA Word Table - Select More than 1 Column at a time - Apply Formatting how to apply table style WITHOUT setting it as a table? dylansmith Excel 9 05-16-2014 07:25 PM
Conditional Formatting: How to dynamically apply to an expanding table? tinfanide Excel 0 10-18-2013 06:34 AM
Apply formatting html version Kreol2013 Word VBA 0 08-26-2013 05:08 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:18 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft