View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
jhvniek jhvniek is offline
external usenet poster
 
Posts: 1
Default Determine address of pagebreak preview

On Jul 31, 4:16*pm, Mark Driscol wrote:
If I have text in cell A1 that visually extends over several columns,
viewing the worksheet in Page Break Preview shows the number of
columns that will be printed. *Is it possible in VBA to determine what
this Page Break Preview address is, e.g., A1:F1?

Thanks in advance.

Mark


Hi I played around and this is my suggestion

Sub Sub_hpagebreaks()


Dim n As Variant

For n = 1 To ActiveSheet.HPageBreaks.Count
Debug.Print ActiveSheet.HPageBreaks(n).Location.Address
Next



End Sub