Table row heights

F

Francis Hookham

Rows in the third column of table pasted into Word 2000 from XL has text
wrapped in many cells but the (row) height of the individual cells does not
always equal what it should be for the number of wrapped rows of text in the
cell. Often even a single row cell is deeper that it should be



Can anyone suggest a macro which would check how deep a cell should be for
the amount of wrapping and set the row accordingly



How does one write a while/wend to run to the bottom - is there a way of
determining how many rows there are?



I have to do this regularly and it is tedious manually dragging each row to
suit - Office 2000 on this PC but could use 2002 on laptop



Francis Hookham
 
S

Shauna Kelly

Hi Francis

You can avoid this problem by setting the row heights in Excel using format
Row > Autofit.

You don't need a programming solution to re-set the row heights in Word.
Click anywhere in the table. Do Table > Select Table. Now, Table >
Properties. On the Row tab, un-tick the "Specify height" box.

If you really need to automate this, try something like the following:

Sub ReSetRowHeights()

If Selection.Information(wdWithInTable) Then

Selection.Tables(1).Rows.HeightRule = wdRowHeightAuto

Else

MsgBox "The insertion point needs to be" _
& "in a table for this to work."

End If

End Sub


Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
 
F

Francis Hookham

Thanks Shauna - it is becasue Row>Autofit did not seem to work that I asked
the question
- I'll take it away with me tomorrow on holiday(!) and enjoy trying to
building it into an interesting XL macro which pastes into Word

I might post again in about 10 days if I still have probs

Francis Hookham
 

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