Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
I am new at using Excel and I want to limit the amount of pages on a
worksheet from 1 to 12 pages. How do I end it so I don't have hundreds of pages in my file? |
#2
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Getting the page count for a sheet in Excel is sometimes a bit iffy, but you
can get a good approximation. Rather than going through a lot of code to actually lock up a sheet at some point that might or might not be when you want to, you can alert yourself when you select a sheet and then make the decision to continue using it or not. Put the following code into the worksheet event for each worksheet you want to keep an eye on. To put the code into the worksheet's event handling area, choose the sheet, right-click on the worksheet's tab and choose [View Code] from the list, then copy the code below and paste it into the module presented to you. Private YouHaveBeenWarned As Boolean Private Sub Worksheet_Activate() If Not YouHaveBeenWarned Then MsgBox "This sheet is now approximately " & _ ActiveSheet.HPageBreaks.Count * ActiveSheet.VPageBreaks.Count + 1 & _ " printout pages in size." YouHaveBeenWarned = True End If End Sub Private Sub Worksheet_Deactivate() YouHaveBeenWarned = False End Sub Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Not YouHaveBeenWarned Then MsgBox "This sheet is now approximately " & _ ActiveSheet.HPageBreaks.Count * ActiveSheet.VPageBreaks.Count + 1 & _ " printout pages in size." YouHaveBeenWarned = True End If End Sub "Fredfixit" wrote: I am new at using Excel and I want to limit the amount of pages on a worksheet from 1 to 12 pages. How do I end it so I don't have hundreds of pages in my file? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
no of pages in excel worksheet (not workbook) | Excel Discussion (Misc queries) | |||
Is there a limit to the number of formulas in an Excel worksheet? | Excel Worksheet Functions | |||
how do I set pages to only even numbers in excel worksheet | Excel Discussion (Misc queries) | |||
Excel Worksheet Limit | Excel Discussion (Misc queries) | |||
How do I limit the number of rows in an Excel worksheet. | Excel Worksheet Functions |