Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 179
Default VPageBreaks in excel.

Jyoti

Here's an example that tells you where the page breaks are, deletes them and
sets one to the last visible column.

Sub FindVPB()

Dim vpb As VPageBreak
Dim vCount As Long
Dim i As Long
Dim LastVisible As Range
Dim TempRange As Range

Set TempRange = Sheet1.UsedRange(Sheet1.UsedRange.Count).Offset(1, 1)
TempRange.Value = 1

For Each vpb In Sheet1.VPageBreaks
If vpb.Type = xlPageBreakManual Then
MsgBox "Manual vertical break at " & _
vpb.Location.Address
vCount = vCount + 1
End If
Next vpb

If vCount 0 Then
For i = vCount To 1 Step -1
Sheet1.VPageBreaks(i).Delete
Next i
End If

With ActiveWorkbook.Windows(1)
Set LastVisible = _
.VisibleRange.Columns(.VisibleRange.Columns.Count)
End With

Sheet1.VPageBreaks.Add LastVisible
TempRange.ClearContents

End Sub

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.


"Jyoti" wrote in message
...
Hi,

Using VBA code how can u find out which column the
vertical page break is set to
and how can u change this vertical pagebreak to the last
visible column.

Thanx
Jyoti.



  #2   Report Post  
Posted to microsoft.public.excel.programming
Jkj Jkj is offline
external usenet poster
 
Posts: 1
Default VPageBreaks in excel.


Thanx Dick


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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



All times are GMT +1. The time now is 03:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"