ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Perplexed (https://www.excelbanter.com/excel-programming/318334-perplexed.html)

scrabtree23[_3_]

Perplexed
 
I am running Excel 2000. I have posted variations of this question off and
on for several weeks and no one has offered a workable soulution. Here is a
simple code:

Dim Srt As Range
Set Srt = Sheets("Code").Range("P2")
Selection.AutoFilter Field:=7, Criteria1:=Srt

Field 7 ties to a column of data filled with dates. Range P2 is one of
those dates. The data filters but everything is hiden??? If I change one
value in field seven to text instead of a date (say the word Joe) and change
Rane P2 to ("Joe") then the table autofilters and displays the data filtered
by the Joe criteria.

I am perplexed. Why won't this code work correctly with a date? How can I
fix this. I need this to work badly.

Tushar Mehta

Perplexed
 
Does field 7 have a date or a date-and-time? How about cell P2?

Click in a cell in field 7 then in P2 and change the format to
'General.' What do you see in the cell/formula bar?

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
I am running Excel 2000. I have posted variations of this question off and
on for several weeks and no one has offered a workable soulution. Here is a
simple code:

Dim Srt As Range
Set Srt = Sheets("Code").Range("P2")
Selection.AutoFilter Field:=7, Criteria1:=Srt

Field 7 ties to a column of data filled with dates. Range P2 is one of
those dates. The data filters but everything is hiden??? If I change one
value in field seven to text instead of a date (say the word Joe) and change
Rane P2 to ("Joe") then the table autofilters and displays the data filtered
by the Joe criteria.

I am perplexed. Why won't this code work correctly with a date? How can I
fix this. I need this to work badly.


Alan Beban[_2_]

Perplexed
 
scrabtree23 wrote:
I am running Excel 2000. I have posted variations of this question off and
on for several weeks and no one has offered a workable soulution. Here is a
simple code:

Dim Srt As Range
Set Srt = Sheets("Code").Range("P2")
Selection.AutoFilter Field:=7, Criteria1:=Srt

Field 7 ties to a column of data filled with dates. Range P2 is one of
those dates. The data filters but everything is hiden??? If I change one
value in field seven to text instead of a date (say the word Joe) and change
Rane P2 to ("Joe") then the table autofilters and displays the data filtered
by the Joe criteria.

I am perplexed. Why won't this code work correctly with a date? How can I
fix this. I need this to work badly.


Sounds like it already does :-)

Alan Beban

scrabtree23[_3_]

Perplexed
 
Both are formatted to date mm/dd/yy. When I click either I would see i.e.
04/15/2003

"Tushar Mehta" wrote:

Does field 7 have a date or a date-and-time? How about cell P2?

Click in a cell in field 7 then in P2 and change the format to
'General.' What do you see in the cell/formula bar?

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
I am running Excel 2000. I have posted variations of this question off and
on for several weeks and no one has offered a workable soulution. Here is a
simple code:

Dim Srt As Range
Set Srt = Sheets("Code").Range("P2")
Selection.AutoFilter Field:=7, Criteria1:=Srt

Field 7 ties to a column of data filled with dates. Range P2 is one of
those dates. The data filters but everything is hiden??? If I change one
value in field seven to text instead of a date (say the word Joe) and change
Rane P2 to ("Joe") then the table autofilters and displays the data filtered
by the Joe criteria.

I am perplexed. Why won't this code work correctly with a date? How can I
fix this. I need this to work badly.




All times are GMT +1. The time now is 02:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com