Less than or equal to question

Keith412

New Member
Joined
Mar 2, 2008
Messages
41
I am having an issue with the below. What it is supposed to do is filter based on the date that is entered as "strName". So the macro runs, it pops up, i put in todays date. For instance, i would type in 11/16/2009 and it would filter by 11/16/2009 or before, hence eliminating anything from 11/17 and forward.

strName = InputBox("Enter todays date, ex] 11/18/2009", "Filter by Name")

ActiveSheet.Range("$A$1:$L$555").AutoFilter Field:=7, Criteria1:= _
" <=" = strName, Operator:=xlAnd

suggestions?

Thank you,
Keith412
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Nogslaw

Well-known Member
Joined
Jul 9, 2004
Messages
904
Slight change:

Rich (BB code):
strName = InputBox("Enter todays date, ex] 11/18/2009", "Filter by Name")

ActiveSheet.Range("$A$1:$L$555").AutoFilter Field:=7, Criteria1:= _
"<=" & strName
 

Watch MrExcel Video

Forum statistics

Threads
1,130,447
Messages
5,642,209
Members
417,262
Latest member
andrewd1

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
Top