Add padding every odd row
Add padding every odd row
Add padding every odd row
Add padding every odd row
Add padding every odd row
Add padding every odd row Add padding every odd row Add padding every odd row Add padding every odd row Add padding every odd row Add padding every odd row Add padding every odd row Add padding every odd row
Add padding every odd row Add padding every odd row
Add padding every odd row
Go Back  Xtreme Visual Basic Talk > > > > Add padding every odd row


Reply
 
Thread Tools Display Modes
  #1  
Old 08-24-2016, 09:39 AM
jim77 jim77 is offline
Newcomer
 
Join Date: Aug 2016
Posts: 8
Default Add padding every odd row


Hello,
I am using the following code to loop through and remove the cell border of all the cells on even rows in a table. I also need to change the top padding on the cells in the odd rows including row 1. I've tried modifying this code but can't get it to work. This can be done using a separate sub if that will work.
Code:
Sub ModifyActiveTable()
Dim i As Long
With Selection
  If .Information(wdWithInTable) = False Then Exit Sub
  With .Tables(1)
    
    For i = 1 To .Rows.Count
      'Removes borders from every 2nd row
      If i Mod 2 = 0 Then
        With .Rows(i).Cells
          .Borders(wdBorderTop).LineStyle = wdLineStyleNone
        End With
      End If
    Next
  End With
End With
End Sub
Reply With Quote
Reply

Tags
row, cells, rows, odd, padding, code, false, dim, .informationwdwithintable, selection, modifyactivetable, removes, .rowsi.cells, wdlinestylenone, mod, 2nd, .tables1, .rows.count, borders, exit, border, cell, table, remove, loop


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Add padding every odd row
Add padding every odd row
Add padding every odd row Add padding every odd row
Add padding every odd row
Add padding every odd row
Add padding every odd row Add padding every odd row Add padding every odd row Add padding every odd row Add padding every odd row Add padding every odd row Add padding every odd row
Add padding every odd row
Add padding every odd row
 
Add padding every odd row
Add padding every odd row
 
-->