#1
|
|||
|
|||
How to delete page not worksheet?
I can't figure out how to delete a page, not a worksheet, from a worksheet.
|
#2
|
|||
|
|||
Hi Rec
There is no concept of pages in a Spreadsheet that is why you are unable to do it. You would simply have to highlight the number of rows you wish to delete and then delete them. Tony |
#3
|
|||
|
|||
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
|
#4
|
|||
|
|||
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 |
#5
|
|||
|
|||
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.
|
#6
|
|||
|
|||
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 |
#7
|
||||
|
||||
Select the range you want to delete, then choose Delete > Delete Cells and, depending on how you want the rest of the worksheet to be arranged after the deletion, 'Shift cells' either left or up.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
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 |
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 |