PC Review


Reply
Thread Tools Rate Thread

Determine address of pagebreak preview

 
 
Mark Driscol
Guest
Posts: n/a
 
      31st Jul 2009
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

 
Reply With Quote
 
 
 
 
arjen van...
Guest
Posts: n/a
 
      31st Jul 2009
I'm not sure if you can get the address of the pagebreakview, but you can
return the address of the print area, which should be what you see in the
pagebreak view.

Dim rngPr As String
rngPr = Sheets("Sheet1").PageSetup.PrintArea

Then, if you need, you can extract the column from this string.
 
Reply With Quote
 
jhvniek
Guest
Posts: n/a
 
      1st Aug 2009
On Jul 31, 4:16*pm, Mark Driscol <djdris...@gmail.com> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cant move pagebreak in PageBreak View in Excel2003 =?Utf-8?B?VmFzYW50aGFu?= Microsoft Excel Worksheet Functions 1 22nd Aug 2007 03:28 PM
How can I rid Page 1 watermark in Pagebreak Preview? =?Utf-8?B?UGVhY2VmdWwgSm95?= Microsoft Excel Worksheet Functions 1 28th Apr 2007 12:57 AM
vb to determine if preview or print? a Microsoft Access Reports 1 22nd Mar 2006 12:12 AM
Remove page number under pagebreak preview =?Utf-8?B?R2FyeQ==?= Microsoft Excel Misc 1 4th May 2005 04:59 AM
determine pagebreak using VBA =?Utf-8?B?bWlyZWM=?= Microsoft Excel Programming 2 15th Apr 2005 01:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:43 PM.