Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

formatting tables automatically in word 2000 1

Status
Not open for further replies.

peterh3244

Programmer
May 21, 2003
8
IE
Someone help please...

I have a macro in WORD 2000 that allows data to be re-formatted into tables. However if the two is split over two pages, but small enough to fit on one page, then it should start on a new page.

Can anyone help please...

Even showing me how to go to the first and last cells in a table would be great.
 
Hi peterh3244,

I just answered your other question about AllowPageBreaks so I presume you've found that part of your answer.

Tables in Word can be complicated because not all rows necessarily have the same number of columns. To get the first cell ..

Code:
ActiveDocument.Tables(1).Cell(1,1).select

.. should always work. Getting the last cell is trickier, but if your table is simple (which I suspect it is), this should be OK ..

Code:
ActiveDocument.Tables(1).Cell(ActiveDocument.Tables(1).Rows.count, ActiveDocument.Tables(1).columns.count).select

.. just remember that it doesn't always work.

Enjoy,
Tony
 
Thank you
I am very glad of your help

Cheers

Peter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top