XL5: Unexpected Results Copying/Pasting Filtered ListLast reviewed: September 12, 1996Article ID: Q115429 |
The information in this article applies to:
SYMPTOMS In Microsoft Excel version 5.0, when you run a recorded Visual Basic macro to copy and paste a filtered list, you may receive unexpected results. When you manually copy a filtered list and then paste it, only the filtered items are pasted. However, when you use a recorded macro to do this same task, the macro may paste all of the items in the list, not just the filtered items. NOTE: This unexpected behavior does not occur when you run a macro recorded in the Microsoft Excel 4.0 Macro language.
STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Microsoft Excel for Windows version 5.0c.
WORKAROUNDIn Visual Basic, Applications Edition, the Selection.CurrentRegion.Select method will select all items in a list, not just the filtered items. To select only the visible cells before you perform the copy, specify the following just before the Selection.Copy command in the module sheet:
Selection.SpecialCells(xlVisible).SelectTo record a macro with only visible cells selected, do the following before you choose the Copy command:
|
KBCategory: kbusage kbmacro
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |