help with filtering when recording

jordanburch

Active Member
Joined
Jun 10, 2016
Messages
440
Office Version
  1. 2016
Hey guys,

I have the following

ActiveSheet.Range("$A$1:$BS$5072").AutoFilter Field:=71, Criteria1:="<>#N/A", _
Operator:=xlOr, Criteria2:="<>"


basically I want it to filter out na and blanks and display anything else. It doesnt seem to be working, but the code isnt giving me an error. Thoughts?

Jordan
 

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.
In what way isn't it working?
Also are the #N/A formula errors?
 
Upvote 0
In what way isn't it working?
Also are the #N/A formula errors?
its pulling through all data. I need to to pull through the matches with the rows only, but that could change from time to time so I want to simply exclude the na and the blanks and copy paste. I think I need an array because I want them both filtered I change it to such

ActiveSheet.Range("$A$1:$BS$5072").AutoFilter Field:=71, Criteria1:=Array( _
"<>#N/A", "<>"), Operator:=xlFilterValues

will that fix my issue?
 
Upvote 0
its pulling through all data. I need to to pull through the matches with the rows only, but that could change from time to time so I want to simply exclude the na and the blanks and copy paste. I think I need an array because I want them both filtered I change it to such

ActiveSheet.Range("$A$1:$BS$5072").AutoFilter Field:=71, Criteria1:=Array( _
"<>#N/A", "<>"), Operator:=xlFilterValues

will that fix my issue?
so i tested it out and it errors out and does not work
 
Upvote 0
You didn't answer this part of my question
Also are the #N/A formula errors?
 
Upvote 0
In that case just change the xlOr in your original code to xlAnd
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,924
Messages
6,122,293
Members
449,077
Latest member
Rkmenon

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