View Single Post
 
Old 05-16-2016, 02:47 PM
Supunsam Supunsam is offline Windows 10 Office 2013
Novice
 
Join Date: May 2016
Posts: 2
Supunsam is on a distinguished road
Question Change Cell Margin with a Macro

Hi guys,

I'm very new to VBA and i would really appreciate if you guys can help me on this macro i'm working on. I have word document contains tables formatted with cell margin option in word. I was trying to convert these in to Paragraph indents. So far i came up with this:

Sub CellPadding()

Dim myCell As Cell
Dim myRow As Row
Dim myTable As Table

Set myTable = Selection.Tables(1)

With myTable

For Each myRow In myTable.Rows
For Each myCell In myRow.Cells

If myCell.LeftPadding = CentimetersToPoints(0.5) Then
Set ParagraphForamat.LeftIndent = 72

End If

Next
Next

End With

End Sub


I might did something stupid in this macro. Please help me to solve this issue. basically i want to change the cell padding value to paragraph indent in the cell.
Reply With Quote