![]() |
|
#1
|
|||
|
|||
![]() 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 ![]() |
#2
|
|||
|
|||
![]()
But if you insist, you can do it this way
![]() Sub DeletePage() ActiveWindow.View = xlPageBreakPreview Range(Rows(ActiveSheet.HPageBreaks(1).Location.Row ),Rows(ActiveSheet.HPageBreaks(2).Location.Row)).E ntireRow.Delete End Sub |
#3
|
|||
|
|||
![]()
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.
|
#4
|
|||
|
|||
![]()
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 |
![]() |
Tags |
delete a page |
|
![]() |
||||
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 |
![]() |
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 |