LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default vba autofilter problem


Autofilter uses a string when comparing and the value number of a cell
with a date is a number. The number will not match the string. the
best solution is this

From :

Cells.AutoFilter Field:=4,
Criteria1:=Sheets("Worksheet").Range("Q2").Value


To :
DateStr = format(Sheets("Worksheet").Range("Q2").Value,"mm-dd-yy")
Cells.AutoFilter Field:=4,
Criteria1:=DateStr


The "mm-dd-yy" must match the format of the data in the worksheet.
Change the format as required.


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=165290

Microsoft Office Help

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Autofilter problem Lawman Excel Discussion (Misc queries) 4 February 28th 08 04:48 PM
Problem with AutoFilter John Quinn Excel Programming 8 July 6th 07 02:04 AM
Problem using Autofilter [email protected] Excel Programming 1 May 22nd 07 12:15 AM
AutoFilter VBA Problem Michael Link Excel Discussion (Misc queries) 1 July 28th 06 04:41 PM
AutoFilter Problem longbow Excel Programming 3 November 24th 03 06:35 AM


All times are GMT +1. The time now is 09:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"