I Want to Filter my sheet and want all data before current date and # N/A

Altamash

New Member
Joined
Jul 25, 2021
Messages
16
Office Version
  1. 2019
Platform
  1. Windows
Here is my code and i am unable to filter data before current date.
can anyone please tell me how to do that.
I want to put that code in below bold codes.




Sub ReplaceNAwith0InColumnC()
'
' ReplaceNAwith0InColumnC Macro
'

'
Range("C1").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$K$1000").AutoFilter Field:=3, Criteria1:="#N/A"
Range("C2").Select
ActiveCell.FormulaR1C1 = "0"
Range("C2").Select
Selection.Copy
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste
Selection.End(xlUp).Select
Application.CutCopyMode = False
Selection.AutoFilter
Selection.AutoFilter
Range("D1").Select
ActiveSheet.Range("$A$1:$K$1000").AutoFilter Field:=4, Criteria1:="Check"
Range("E1").Select
Selection.AutoFilter
Selection.AutoFilter
Range("D1").Select
ActiveSheet.Range("$A$1:$K$1000").AutoFilter Field:=4, Criteria1:="Check"
Range("F1").Select
ActiveSheet.Range("$A$1:$K$1000").AutoFilter Field:=6, Criteria1:="<" & Now()


End Sub
 
Hi,

Thanks for the help.
It worked by changing the folrmula.
 
Upvote 0

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Forum statistics

Threads
1,216,077
Messages
6,128,679
Members
449,463
Latest member
Jojomen56

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