help with filtering when recording

jordanburch

Active Member
Joined
Jun 10, 2016
Messages
439
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

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
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,213,568
Messages
6,114,348
Members
448,570
Latest member
rik81h

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