The information in this article applies to:
SYMPTOMSIn Microsoft Excel, if you use the macro recorder to record a macro for changing page setup options (such as page orientation or margins) for a group of sheets, the resulting macro only sets the options for the sheet that is active when you recorded the macro--it does NOT set the option for all of the selected sheets as expected. CAUSE
This problem occurs because the macro recorder records the sheet object as
ActiveSheet (which is a single sheet). Therefore, PageSetup becomes a
property of a single sheet.
Q126313 XL5: Macro Doesn't Function on Multiple Sheets in Group Mode WORKAROUNDTo work around this behavior, modify the macro so that it loops through each sheet in the selection individually, as in the following example:
Microsoft provides examples of Visual Basic procedures 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 Visual Basic procedure is provided 'as is' and
Microsoft does not guarantee that it can be used in all situations.
Microsoft does not support modifications of this procedure to suit customer
requirements for a particular purpose.
STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available. Additional query words: 5.00c wrong page setup improper xl
Keywords : |
Last Reviewed: October 6, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |