S
skrimpy
Ill try this question a different way. Using Word 2000, I have a tabl
that stretches from one page to the next. I want to write a loop tha
will count the number of rows in each page so that I can jump to th
last row in any page but not the end of the table(The number of row
will be variable).
Ive written this loop to count the number of cells in the existin
table on page one(excluding the cells on page two in the count), an
return the number below the current table. Instead of output being th
the number of rows on page one, it prints the number "1". Thanks fo
any help that any can give me!
Sub CountCells()
Dim X, Y As Integer
X = ActiveDocument.BuiltInDocumentProperties("Number of Pages")
Y = 1 ' Initialize variables
Do While X < 2 'Loop
Selection.MoveDown Unit:=wdLine, Count:=1 ' Move down a row.
Y = Y + 1 'Increment Y
Loop
Selection.EndKey Unit:=wdColumn
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeText Text:=Y
End Su
that stretches from one page to the next. I want to write a loop tha
will count the number of rows in each page so that I can jump to th
last row in any page but not the end of the table(The number of row
will be variable).
Ive written this loop to count the number of cells in the existin
table on page one(excluding the cells on page two in the count), an
return the number below the current table. Instead of output being th
the number of rows on page one, it prints the number "1". Thanks fo
any help that any can give me!
Sub CountCells()
Dim X, Y As Integer
X = ActiveDocument.BuiltInDocumentProperties("Number of Pages")
Y = 1 ' Initialize variables
Do While X < 2 'Loop
Selection.MoveDown Unit:=wdLine, Count:=1 ' Move down a row.
Y = Y + 1 'Increment Y
Loop
Selection.EndKey Unit:=wdColumn
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeText Text:=Y
End Su