View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Ed from AZ Ed from AZ is offline
external usenet poster
 
Posts: 120
Default How many rows fit a single page?

Thanks, Jim. The margins for this will not change.

What is the "400"? Points? Or just an arbitrary number used for
measurement according to whatever Excel is using?

Ed


On Apr 1, 12:49*pm, Jim Thomlinson <James_Thomlin...@owfg-Re-Move-
This-.com wrote:
You are going to have certain difficulties with this as it depends on the
margins you set in Word. When those change your code will need to change.
Here is some simple code to get you started. It does not look at the margins
in Word...

Sub test()
* * Dim dbl As Double
* * Dim rng As Range
* * Dim rngToSearch As Range

* * Set rngToSearch = Range("A1", Cells(Rows.Count, "A").End(xlUp))
* * For Each rng In rngToSearch
* * * * dbl = dbl + rng.Height
* * * * If dbl 400 Then 'You will need to change this to suit
* * * * * * MsgBox rng.Address
* * * * * * dbl = 0
* * * * End If
* * Next rng
End Sub
--
HTH...

Jim Thomlinson



"Ed from AZ" wrote:
(Word and Excel 2003) *I have an Excel table that my code scans, picks
so many rows, and then copies that into a Word document as a table.
This worked okay when all my rows were a single fixed height. *I've
just received instructions to add some info items to this table, which
will increase some row sizes due to word wrap.


Is there a good way to determine how many rows will fit inside the
margins of my Word page? *Perhaps add the height of each row until I
get to a certain number? *Or can I detect and use the page break
somehow for this?


Ed- Hide quoted text -


- Show quoted text -