Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can i use IsEmpty and IF this way? What's wrong here?


Opps, i have another problem. I try to do the filtering by this way:


Code
-------------------
For i = 1 To 10
If Not (IsEmpty(arr.Cells(i, 2)) And IsEmpty(arr.Cells(i, 3))) Then
Selection.AutoFilter Field:=5, Criteria1:=arr(i, 2), Operator:=xlAnd, Criteria2:=arr(i, 3)

ElseIf Not (IsEmpty(arr.Cells(i, 4)) And IsEmpty(arr.Cells(i, 5))) Then
Selection.AutoFilter Field:=6, Criteria1:=arr(i, 4), Operator:=xlAnd, Criteria2:=arr(i, 5)

End If
End If
Cells(38041 + j, 6 + i).Value = Range("F38039")
Next
-------------------


however, the results doesnt look to be what i am especting. And i thin
that it is because the criteria i selected in Field 5 doesnt reset eac
time a new "i" is used.
Can anyone tell me how to reset the Autofiltering after each "i" i
executed?

Thanks agai

--
changeabl
-----------------------------------------------------------------------
changeable's Profile: http://www.excelforum.com/member.php...fo&userid=1571
View this thread: http://www.excelforum.com/showthread.php?threadid=27452

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Can i use IsEmpty and IF this way? What's wrong here?

if Activesheet.filterMode then
ActiveSheet.ShowAll
End If
For i = 1 To 10
If Not (IsEmpty(arr.Cells(i, 2)) And IsEmpty(arr.Cells(i, 3))) Then
Selection.AutoFilter Field:=5, Criteria1:=arr(i, 2), Operator:=xlAnd,
Criteria2:=arr(i, 3)

ElseIf Not (IsEmpty(arr.Cells(i, 4)) And IsEmpty(arr.Cells(i, 5))) Then
Selection.AutoFilter Field:=6, Criteria1:=arr(i, 4), Operator:=xlAnd,
Criteria2:=arr(i, 5)

End If
End If
Cells(38041 + j, 6 + i).Value = Range("F38039")
Next i



"changeable" wrote in message
...

Opps, i have another problem. I try to do the filtering by this way:


Code:
--------------------
For i = 1 To 10
If Not (IsEmpty(arr.Cells(i, 2)) And IsEmpty(arr.Cells(i, 3))) Then
Selection.AutoFilter Field:=5, Criteria1:=arr(i, 2), Operator:=xlAnd,

Criteria2:=arr(i, 3)

ElseIf Not (IsEmpty(arr.Cells(i, 4)) And IsEmpty(arr.Cells(i, 5))) Then
Selection.AutoFilter Field:=6, Criteria1:=arr(i, 4), Operator:=xlAnd,

Criteria2:=arr(i, 5)

End If
End If
Cells(38041 + j, 6 + i).Value = Range("F38039")
Next i
--------------------


however, the results doesnt look to be what i am especting. And i think
that it is because the criteria i selected in Field 5 doesnt reset each
time a new "i" is used.
Can anyone tell me how to reset the Autofiltering after each "i" is
executed?

Thanks again


--
changeable
------------------------------------------------------------------------
changeable's Profile:

http://www.excelforum.com/member.php...o&userid=15714
View this thread: http://www.excelforum.com/showthread...hreadid=274524



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
Can i use IsEmpty and IF this way? What's wrong here? changeable[_6_] Excel Programming 0 November 2nd 04 03:21 PM
Can i use IsEmpty and IF this way? What's wrong here? changeable[_5_] Excel Programming 1 November 2nd 04 03:03 PM
Help with IsEmpty Fred Excel Programming 1 February 10th 04 03:12 PM
isempty mike allen Excel Programming 2 January 3rd 04 10:45 PM
vba: isempty chick-racer[_37_] Excel Programming 3 November 17th 03 09:52 PM


All times are GMT +1. The time now is 01:47 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"