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

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
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
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,520
Members
449,088
Latest member
RandomExceller01

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