Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-20-2011, 02:32 AM
Catalin.B Catalin.B is offline How to delete page not worksheet? Windows Vista How to delete page not worksheet? Office 2007
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default


I guess you want to delete a worksheet from a workbook. (only sheet 1, for example). Simply right click on worksheet name and select Delete
Reply With Quote
  #2  
Old 05-20-2011, 09:19 AM
Catalin.B Catalin.B is offline How to delete page not worksheet? Windows Vista How to delete page not worksheet? Office 2007
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

But if you insist, you can do it this waychange page break number as you need)

Sub DeletePage()
ActiveWindow.View = xlPageBreakPreview
Range(Rows(ActiveSheet.HPageBreaks(1).Location.Row ),Rows(ActiveSheet.HPageBreaks(2).Location.Row)).E ntireRow.Delete

End Sub
Reply With Quote
  #3  
Old 05-20-2011, 09:24 AM
Catalin.B Catalin.B is offline How to delete page not worksheet? Windows Vista How to delete page not worksheet? Office 2007
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

But this method depends on page breaks, if you reset page breaks, you will delete another range than intended. My advice is to set another method to analize which rows to delete.
Reply With Quote
  #4  
Old 05-20-2011, 10:12 AM
Catalin.B Catalin.B is offline How to delete page not worksheet? Windows Vista How to delete page not worksheet? Office 2007
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

Sorry, previous post deletes the second page AND the first row of the third page
This one works ok. ( from my point of view )
Sub DeletePage()

ActiveWindow.View = xlPageBreakPreview
Range(Rows(ActiveSheet.HPageBreaks(1).Location.Row ), Rows(ActiveSheet.HPageBreaks(2).Location.Row - 1)).EntireRow.Delete


End Sub
Reply With Quote
Reply

Tags
delete a page



Similar Threads
Thread Thread Starter Forum Replies Last Post
delete email message via blackberry and have it delete on my pop3 and my outlook Iamthestorm Outlook 2 10-28-2010 12:21 AM
How to delete page not worksheet? Can I use a formula to name a worksheet? nolesca Excel 3 06-07-2010 04:02 PM
Unable to delete the last blank page. anandjeevakan Word 0 12-11-2009 05:20 AM
Printing multiple page worksheet with watermark zany Excel 2 11-27-2009 01:33 AM
How do you delete a blank page at end? aerophil Word 4 10-24-2009 05:04 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:19 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft