hi, i found this code somewhere. this code was supposed to filter data for a period of 30 days.
my case is that i have 2 strings of dates. in the dd-mmm-yy format. both of the dates can be any day. how do i modify this code to suit my case?
VB:
Filtermonth Format(Sheets("Reference").Cells(ComboBox1.ListIndex + 2, 19), "dd-mmm-yyyy"), _
Format(Sheets("Reference").Cells(ComboBox6.ListIndex + 32, 19), "dd-mmm-yyyy")
and the support code for the "FilterMonthSolvent" is as below:
VB:
Sub FilterMonthSolvent(strCriteria3 As String, strCriteria4 As String)
With Sheet2
.AutoFilterMode = False
.Range("A1:O1").AutoFilter
.Range("A1:O1").AutoFilter Field:=3, Criteria1:=">=" & strCriteria3, _
Operator:=xlAnd, Criteria2:="<=" & strCriteria4
End With
End Sub
thanks!
Bookmarks