XL5: Unexpected Results Copying/Pasting Filtered List |
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.
Microsoft 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.
In 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).Select
To record a macro with only visible cells selected, do the following before
you choose the Copy command:Additional query words: Filter
Keywords :
Version : 5.00
Platform : WINDOWS
Issue type :
Technology :
|
Last Reviewed: September 21, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |