How to remove indent in table cell from Excel

  • Thread starter christophercbrewster via OfficeKB.com
  • Start date
C

christophercbrewster via OfficeKB.com

I copied part of an XLS spreadsheet to create a Word table. The text in many
cells is indented in the original, but I need to make these flush left within
the cell. But I can't find a place within Word where this indent is shown:
it's not in the table cell specs nor in the paragraph definition. Is there a
way to unindent?

My purpose is to do this within VBA, in case that changes the answer.

--
Christopher Brewster
Lockheed Martin, Eagan MN

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/ms-word-general/200911/1
 
C

christophercbrewster via OfficeKB.com

Thanks, but that doesn't get rid of the inherited indents-- it only gets rid
of the cell padding. As I said, I was unable to get rid of the indents using
the Table Properties dialog. Something in the text from Excel carries an
indent with it, but I can't find any way that it's defined within Word. If
you make a test worksheet in Excel and use the indent button on a few cells
(use different indents in different cells to make it conspcuous), then import
it to Word, I think you'll see the effect I mean.
Dim i As Long, j As Long
With ActiveDocument.Tables(1)
For i = 1 To .Rows.Count
For j = 1 To .Columns.Count
.Cell(i, j).LeftPadding = 0
Next j
Next i
End With
I copied part of an XLS spreadsheet to create a Word table. The text in
many
[quoted text clipped - 6 lines]
My purpose is to do this within VBA, in case that changes the answer.

--
Christopher Brewster
Lockheed Martin, Eagan MN

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/ms-word-general/200911/1
 
T

Terry Farrell

Try selecting the cells and reapply the Style.

--
Terry Farrell - MSWord MVP

christophercbrewster via OfficeKB.com said:
Thanks, but that doesn't get rid of the inherited indents-- it only gets
rid
of the cell padding. As I said, I was unable to get rid of the indents
using
the Table Properties dialog. Something in the text from Excel carries an
indent with it, but I can't find any way that it's defined within Word. If
you make a test worksheet in Excel and use the indent button on a few
cells
(use different indents in different cells to make it conspcuous), then
import
it to Word, I think you'll see the effect I mean.
Dim i As Long, j As Long
With ActiveDocument.Tables(1)
For i = 1 To .Rows.Count
For j = 1 To .Columns.Count
.Cell(i, j).LeftPadding = 0
Next j
Next i
End With
I copied part of an XLS spreadsheet to create a Word table. The text in
many
[quoted text clipped - 6 lines]
My purpose is to do this within VBA, in case that changes the answer.

--
Christopher Brewster
Lockheed Martin, Eagan MN

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/ms-word-general/200911/1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top