The information in this article applies to:
SYMPTOMSWhen running a recorded macro that uses the AutoFilter feature, a date that meets the filter criteria is not properly filtered, either appearing when it shouldn't or not appearing when it should. CAUSEThis behavior occurs when you do the following:
RESOLUTION
Change the value assigned to the Criteria1 argument or the Criteria2 argument of the AutoFilter method to match the date format of the date column on the AutoFilter list.
and the cell containing the date in the AutoFilter list is formatted as m/d/yyyy, change the line of code to the following:
MORE INFORMATIONThe AutoFilter feature performs a simple string comparison. When you change the date format of the cell, AutoFilter fails because the string value is now different from the string value recorded for the AutoFilter method. REFERENCESFor more information about the AutoFilter method, from the Visual Basic Editor, click the
Office Assistant, type AutoFilter Method, click Search, and
then click to view "AutoFilter Method." Q176476 OFF: Office Assistant Not Answering Visual Basic Questions Additional query words: XL97 vba
Keywords : kbdta kbdtacode OffVBA KbVBA |
Last Reviewed: January 25, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |