ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Deleting PageBreaks (https://www.excelbanter.com/excel-programming/345757-re-deleting-pagebreaks.html)

asmenut

Deleting PageBreaks
 
Thanks for the help but no go. I tried the ResetAllPageBreaks and it still
wants to break the data down into (3) sheets. And per the VBA Help, the
method only resets.

While I know that you can't "Delete" automatic pagebreaks, there has to be a
way to move them (I can do it in a macro, but I can't duplicate it in the
main program body) :(

"Gary''s Student" wrote:

Try:

ActiveSheet.ResetAllPageBreaks

to clear out all the old breaks
--
Gary''s Student


"asmenut" wrote:

Help. I have some code written that first deletes all data in the sheet
(Cells.Delete shift:=xlUp) and reloads the current information from a
database. When I go to format the sheet (using VBA), I noticed that while I
have set the printarea properly, there are vertical page breaks that I need
to remove so I can print all the data (A1:T#) on one sheet.

I have tried "Set Activesheet.VPageBreaks.Location = Range("T#")",
"ActiveSheet.VPageBreaks.Delete", adn even the macro method "DragOff", but to
no avail.

While I can manually go and reset the pagebreaks, I need a way to do it by
code so that if someone adds new sheets, I can add the sheet(s) to the
existing code to automate. Am I missing something?


Dave Peterson

Deleting PageBreaks
 
After you reset the pagebreaks, try setting the pagesetup to:
fit to 1 page wide by 1 tall.
(File|page setup|page tab)

(record a macro when you do it if you need the code.)

asmenut wrote:

Thanks for the help but no go. I tried the ResetAllPageBreaks and it still
wants to break the data down into (3) sheets. And per the VBA Help, the
method only resets.

While I know that you can't "Delete" automatic pagebreaks, there has to be a
way to move them (I can do it in a macro, but I can't duplicate it in the
main program body) :(

"Gary''s Student" wrote:

Try:

ActiveSheet.ResetAllPageBreaks

to clear out all the old breaks
--
Gary''s Student


"asmenut" wrote:

Help. I have some code written that first deletes all data in the sheet
(Cells.Delete shift:=xlUp) and reloads the current information from a
database. When I go to format the sheet (using VBA), I noticed that while I
have set the printarea properly, there are vertical page breaks that I need
to remove so I can print all the data (A1:T#) on one sheet.

I have tried "Set Activesheet.VPageBreaks.Location = Range("T#")",
"ActiveSheet.VPageBreaks.Delete", adn even the macro method "DragOff", but to
no avail.

While I can manually go and reset the pagebreaks, I need a way to do it by
code so that if someone adds new sheets, I can add the sheet(s) to the
existing code to automate. Am I missing something?


--

Dave Peterson


All times are GMT +1. The time now is 11:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com