Excel Delete Multiple Page Breaks w/in Selected Rows

Joined
Feb 7, 2017
Messages
3
Reaction score
0
I'm new here and would like to say THANK YOU for existing!! I'm so happy I stumbled across this page!
Ok, my question is: how can I remove multiple, manual page breaks within selected rows? I use a Macro to apply the page breaks, among other formatting tasks. I'd love to say that I am the master behind the Macro, but a previous co-worker set it up for me. Hence, my lack of knowledge on building a Macro to remove multiple page breaks simultaneously.
 

Becky

Webmistress
Joined
Mar 25, 2003
Messages
7,424
Reaction score
1,511
Welcome aboard! I'm glad we exist too :)

The easiest way is to use the find and replace. To bring it up, press CTRL+F and then click on the Replace tab. You will need to enter the character code for line breaks in the 'Find what' box, being ALT+010. If you leave the 'Replace with' box empty it will just remove the line breaks. Click on 'Replace all'.

Hope this helps!
 
Joined
Feb 7, 2017
Messages
3
Reaction score
0
Thank you so much! It's not acknowledging the ALT+010 code, though. I hid columns in the attached screenshot for confidential purposes only.
Capture.PNG
 

Becky

Webmistress
Joined
Mar 25, 2003
Messages
7,424
Reaction score
1,511
Ah, you have to hold the Alt button and press 010 on the numpad ;)
 
Joined
Feb 7, 2017
Messages
3
Reaction score
0
Ok; I get the flashing dot now, but it returns with a message stating it can't find the data. I believe the following portion of the macro is responsible for adding the breaks, if that makes a difference:


For x = 2 To LastRw

If Cells(x, 2) <> Cells(x - 1, 2) Then

ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=Cells(x, 2)

End If
 

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

Top