Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 1
Default How can I limit Excel worksheet to 12 pages?

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   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2,203
Default How can I limit Excel worksheet to 12 pages?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
no of pages in excel worksheet (not workbook) S N Excel Discussion (Misc queries) 10 July 31st 08 10:13 AM
Is there a limit to the number of formulas in an Excel worksheet? Del[_2_] Excel Worksheet Functions 3 March 29th 08 06:42 PM
how do I set pages to only even numbers in excel worksheet Olamide Excel Discussion (Misc queries) 0 January 22nd 07 06:52 PM
Excel Worksheet Limit Ef Dublio Excel Discussion (Misc queries) 1 May 18th 05 11:28 AM
How do I limit the number of rows in an Excel worksheet. laforge27 Excel Worksheet Functions 1 November 4th 04 01:42 AM


All times are GMT +1. The time now is 01:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"