Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Dates as input to autofilter?

Hello,

I have a problem with filtering certain date due to dates that the user is
supposed to give in two cells.
Below are excerpt from the code;

Dim FromDate As String
Dim EndDate As String
FromDate = Format(Worksheets("Sheet2").Range("H2").Value, "yyyy-mm-dd")
EndDate = Format(Worksheets("Sheet2").Range("H3").Value, "yyyy-mm-dd")
(...)
MsgBox (FromDate)
Selection.AutoFilter Field:=8, Criteria1:="FromDate", Operator:=xlAnd _
, Criteria2:="<EndDate"

It works fine until the critera are supposed to be set. Then nothing
happends. the result from the filtering is nothing (and there are data
between the towo dates)

Thanks,
Tobias
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Dates as input to autofilter?

Ok, I managed to solve it myself...

"Tobias" skrev:

Hello,

I have a problem with filtering certain date due to dates that the user is
supposed to give in two cells.
Below are excerpt from the code;

Dim FromDate As String
Dim EndDate As String
FromDate = Format(Worksheets("Sheet2").Range("H2").Value, "yyyy-mm-dd")
EndDate = Format(Worksheets("Sheet2").Range("H3").Value, "yyyy-mm-dd")
(...)
MsgBox (FromDate)
Selection.AutoFilter Field:=8, Criteria1:="FromDate", Operator:=xlAnd _
, Criteria2:="<EndDate"

It works fine until the critera are supposed to be set. Then nothing
happends. the result from the filtering is nothing (and there are data
between the towo dates)

Thanks,
Tobias

Reply
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
Using Autofilter to exclude dates Ian Excel Worksheet Functions 11 August 1st 08 01:41 PM
autofilter using string input KT[_3_] Excel Programming 3 October 28th 04 02:42 PM
Filtering out dates using autofilter sk8rider[_3_] Excel Programming 2 June 16th 04 09:43 PM
Access AutoFilter list for use with input box? Ed[_9_] Excel Programming 4 November 4th 03 01:51 PM
Autofilter input Abdul Salam Excel Programming 1 August 11th 03 02:41 PM


All times are GMT +1. The time now is 04:15 PM.

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

About Us

"It's about Microsoft Excel"