Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-18-2017, 09:11 AM
Alvaro.passi Alvaro.passi is offline VBA color of visible gridlines of tables word (with some merged cells in first rows) Windows 10 VBA color of visible gridlines of tables word (with some merged cells in first rows) Office 2016
Novice
VBA color of visible gridlines of tables word (with some merged cells in first rows)
 
Join Date: Jul 2017
Posts: 6
Alvaro.passi is on a distinguished road
Exclamation VBA color of visible gridlines of tables word (with some merged cells in first rows)

I have more than 500 tables in Word. All of them have horizontal green borders at the top and bottom of the table, and some horizontal lines inside the table. Because of a mistake, some lines inside the same table and between tables have different green colors.
All the tables have merged cell in the first row. Tables have diferent numbers of rows and columns.

I need to unify the color of visible borders of all tables to the same green (RGB:0,128,0).

I'm very new with VBA. I have been looking at this for weeks without any success.

Attached is an example of the tables in my word document.

Someone give me this code, but only works with the first top border:

Sub colorBorders()
Dim i As Integer
Dim tabl As Table
For Each tabl In ActiveDocument.Tables ' iterate all the tables
For i = 1 To tabl.Borders.Count ' iterate all borders for each table
tabl.Borders(i).Color = RGB(0, 128, 0)


Next i
Next tabl
End Sub
Attached Files
File Type: docx Tablas para subir a foro.docx (20.5 KB, 12 views)
Reply With Quote
Reply

Tags
color, table borders, vba word



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA color of visible gridlines of tables word (with some merged cells in first rows) Overcome issues in tables with vertically merged cells rocky2 Word VBA 12 12-22-2016 03:03 AM
VBA merging cells and counting Merged rows Snaybot Excel Programming 2 11-09-2015 03:56 AM
Combining 2 tables into 1 and use Table2's column widths (hoping for workaround dealing merged cells CodingGuruInTraining Word VBA 24 10-07-2015 07:48 PM
VBA color of visible gridlines of tables word (with some merged cells in first rows) Table will not allow sorting because "cells are merged". I can't find the merged cells. wendyloooo Word Tables 1 05-26-2015 01:19 PM
VBA color of visible gridlines of tables word (with some merged cells in first rows) How to make gridlines in cells of tables in MS Word 2007 pgrewal Drawing and Graphics 1 07-18-2014 11:12 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:54 AM.


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