The information in this article applies to:
SYMPTOMSIn Microsoft Excel, if you use a Microsoft Visual Basic for Applications procedure to get the FirstPageNumber property of a sheet, you may receive the value -4105. MORE INFORMATIONMicrosoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft Support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web: http://www.microsoft.com/support/supportnet/overview/overview.aspIn Microsoft Excel, to set the first page number of a sheet, do either of the following: To Manually Set the First Page Number
To Set the First Page Number Using Visual Basic Code
where <value> is an integer from -32765 to 32767, or the word
xlAutomatic.
You can also check and store the FirstPageNumber property of a worksheet in a variable by using this code:
The value returned to <variable> by this statement may be either:
Note that -4105 is the value of the built-in constant "xlAutomatic"; when
the worksheet has "Auto" in its First Page Number edit box, this is the
value actually stored in the FirstPageNumber property.
You can check whether a worksheet is using automatic page numbering by using a line of code such as this:
The following Visual Basic code example illustrates one possible
use of this procedure.
Sample Visual Basic ProcedureThe following sample Sub procedure loops through all of the worksheets in the active workbook, reporting the first page number assigned to each worksheet. If the worksheet is using automatic page numbering, the Sub will report this.
Additional query words: 5.00a 5.00c XL98 XL97 XL7 XL5
Keywords : kbprg kbdta kbdtacode SynFnc PgmOthr KbVBA |
Last Reviewed: November 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |