Keyboard Shortcut for Inserting a Page Break

R

Ron de Bruin

Hi Tandy

As far as I know there is no shortcut
You can use a macro like this and run it from a button

ActiveSheet.HPageBreaks.Add Before:=Cells(ActiveCell.Row, 1)
 
P

Paul B

Tandy, not real short but you could use Alt + i then b
--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
 
G

Guest

Ron,

Thank you so much for your help. I never knew you could create your own
shortcuts using macros. Very convenient! Thank you again!
 
G

Guest

Tandy,
You could put the macro below into your Personal.xls and set it to a
shortcut. It is a toggle that adds and deletes a Horizontal Page Break. To
use the short cut of 'Ctrl-Shift-H', select Tools>Macro>Macros
Hightlight the macro 'HorizontalPageBreakToggle'.
Select Options.
Hold the 'Shift' key and press the 'H' key.
Select 'OK' then 'Cancel'.

'/==============================================/
Public Sub HorizontalPageBreakToggle()
'toggle horizonal page break on and off
Dim blnBreak As Boolean
Dim hBreak As HPageBreak
Dim iHPageBreakItem As Long

On Error Resume Next
blnBreak = False

'if the current cell is at a page break, delete it
For Each hBreak In Application.Worksheets.HPageBreaks
iHPageBreakItem = iHPageBreakItem + 1
If ActiveCell.Row = _
Range(hBreak.Location.Address).Row Then
ActiveSheet.HPageBreaks(iHPageBreakItem).Delete
'page break was found
blnBreak = True
Exit For
End If
Next hBreak

'if the current cell is NOT at a page break, add it
If blnBreak = False Then
ActiveWindow.SelectedSheets.HPageBreaks.Add _
Before:=ActiveCell
End If

End Sub
'/==============================================/

HTH,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top