LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Why my code do not work : - (

soniya..

Either your columns OR B1/C1 contain data that looks like dates but in
fact are strings(text).

OR

your data or b1/c1 contains timeportions



maybe changing to
x = "=" & range("B1").text
y = "=" & Range("C1").text

or
x = "=" & int(range("B1"))
y = "=" & int(range("C1"))



will help, but I suggest to make sure
u use the same data types in search range
and criteria cells



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Soniya" wrote:

Hi all,

this is what i got while recording macro and worked fine..

Sheets("IncomeData").Select
Range("A2").Select
Range(Range("A2:F2"), Range("A2:F2").End
(xlDown)).Select
Selection.AutoFilter Field:=5,
Criteria1:="=01/07/2003", Operator:=xlAnd _
, Criteria2:="<=01/08/2003"

But when I changed it to:

x= "=" & range("B1")
y = "=" & Range("C1")

Range(Range("A2:F2"), Range("A2:F2").End
(xlDown)).Select
Selection.AutoFilter Field:=5, Criteria1:=x,
Operator:=xlAnd _
, Criteria2:=y

then no record shows in the filtered data.. while there
are several records meet the condition..

What would be the possible reason for this strange
behaviour...?

(I am using XL XP)

TIA
Soniya



 
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
Maco code doesn't work. Why? Joe M. Excel Discussion (Misc queries) 2 January 13th 10 07:13 PM
Why does this code not work? rk0909 Excel Discussion (Misc queries) 12 September 4th 08 10:42 PM
Why this code is not work? Error code when select worksheet Excel Worksheet Functions 4 December 4th 07 12:51 AM
code is not to work on sheet1 Allan R Jeffery New Users to Excel 3 August 22nd 06 02:22 PM
Why my code do not work : - ( Bob Phillips[_5_] Excel Programming 0 August 31st 03 01:27 PM


All times are GMT +1. The time now is 04:11 AM.

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"