Filter not work

elsg

Active Member
Joined
Mar 16, 2013
Messages
295
I have formula in F1
i try this code but dont work.
Code:
Sub notWorkFilter()    If Range("F1") > 0 Then
       Range("C16").AutoFilter Field:=1, Criteria1:=Range("D6").Value
      Else
      Exit Sub
    End If
End Sub
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
elsg,

I would think that it's appropriate to first solve your earlier question, before starting a new one.
You did not respond in that topic.
 
Upvote 0
I do not have printer in my house, so I will test when I get to my job.


after testing, I've been posting here on the forum!.


but this post has absolutely nothing to do with the other post.
 
Upvote 0
I don't see your file in front of me, but the syntax is correct.
If you say that "but dont work", that's not really helpful information to help you out.
Do you get an error? Does the autofilter return incorrect rows? ...
 
Upvote 0
when I press F5 does not generate error, nothing happens.
is it because the value of F1 is a formula??
 
Upvote 0
F1 can be a formula, what is its value?
 
Upvote 0
Still, it should work.
Are you working on the correct sheet (since your code does not qualify the ranges with their sheet)?
 
Upvote 0
What are the contents of cell D6?
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,378
Members
448,955
Latest member
BatCoder

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top