Recorded CROSSTAB Macro Is Interactive if Fields Not SelectedLast reviewed: November 29, 1994Article ID: Q88144 |
The information in this article applies to:
SUMMARYIn Microsoft Excel for Windows, it is possible to record a macro that automatically creates a cross-tabulation table. However, when you create your cross-tabulation table, you must select fields for both row categories AND for column categories, or the macro runs the Crosstab ReportWizard instead of building a cross-tabulation table automatically. For information about how to create a cross-tabulation table, see pages 346-356 of the "User's Guide 1" for version 4.0.
MORE INFORMATION
WorkaroundTo correct this problem, record your macro again, this time selecting fields both for row categories and for column categories. After recording your macro, edit the CROSSTAB.CREATE function in your macro to remove the argument values for the category you don't want included. To remove unwanted category argument values:
For example, in the following formula
=CROSSTAB.CREATE({"Vendor",0,"Auto","Auto","NNNNNNN"}, {"Region",0,"Auto","Auto","NNNNNNN"},,TRUE,TRUE,1,TRUE,TRUE)removing the column category argument (field name = Region) results in
=CROSSTAB.CREATE({"Name",0,"Auto","Auto","NNNNNNN"},,,TRUE, TRUE,1,TRUE,TRUE)Notice that the comma in the above formula has been left as a place holder. (The formulas above have been word wrapped for readability. They should appear on one line without any spaces.) When you record a macro that creates a cross-tabulation table, Microsoft Excel enters the CROSSTAB.CREATE function, including its arguments, in a cell on your macro sheet. If you don't select field names for both row categories and column categories when creating your cross-tabulation table, the Microsoft Excel Macro Recorder uses the interactive form of the function
(=RUN"CROSSTAB.CREATE?", FALSE))instead of the non-interactive form:
(=CROSSTAB.CREATE().) REFERENCES"Function Reference," version 4.0, pages 82-84 "User's Guide 1," version 4.0, pages 346-356
|
KBCategory: kbfasttip
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |