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.
 
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!
 
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.webp
 
Ah, you have to hold the Alt button and press 010 on the numpad ;)
 
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
 
Back
Top