Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-22-2015, 01:32 PM
jc491's Avatar
jc491 jc491 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 2013
VBA Novice
VBA Word Table - Select More than 1 Column at a time - Apply Formatting
 
Join Date: Sep 2015
Location: UK
Posts: 55
jc491 is on a distinguished road
Default VBA Word Table - Select More than 1 Column at a time - Apply Formatting

Hi all,




I apolgise if there is a solution already on here, I have not been able to locate it.

I have been trying to solve this problem.

I have tables that I need to format.

I would like to select a number of columns.

I know how to select 1 column and format it.

Can any one advise on how I may be able to select for

example


columns 3, 7 ,9 or any other columns I need to select.

I have looked at and tested various code snippets from:
https://msdn.microsoft.com/en-us/lib.../ff195142.aspx



I still can't work it out.
Code:
Sub FormatColumns()
ActiveDocument.Tables(1).Columns(6).Select
With Selection.Borders(wdBorderLeft)
  .ColorIndex = wdWhite
End With
With Selection.Borders(wdBorderRight)
  .ColorIndex = wdWhite
End With
With Selection.Borders(wdBorderTop)
  .ColorIndex = wdWhite
End With
With Selection.Borders(wdBorderBottom)
  .ColorIndex = wdWhite
End With
With Selection.Borders(wdBorderHorizontal)
  .ColorIndex = wdWhite
End With
End Sub
I am pretty sure that I'm misunderstanding the syntax somewhere.

is this possible:
ActiveDocument.Tables(1).Columns(3,6,9).Select


Later I would like to use the same logic to select multiple rows.


Any advice I would appreciate

Thank you in advance for your time

J

Last edited by macropod; 09-22-2015 at 10:04 PM. Reason: Added code tags & formating
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:46 PM.


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