Hello,
Can someone please modify this from data to date instead. The attachment is searching data for now. I want to switch to search dates.
![]()
Please Login or Register to view this content.
Hello,
Can someone please modify this from data to date instead. The attachment is searching data for now. I want to switch to search dates.
![]()
Please Login or Register to view this content.
Hello,
When I type the date in the message gox i.e. 03/07/23, then it does not search the from A2:A17 because I believed it just searching with just the data. I want someone to modify it for dates search.
Thanks
try using format the sFind exactly with format in column A
PHP Code:
ActiveSheet.Range("$A$2:$A$17").AutoFilter Field:=1, Criteria1:=Format(sFind, "mm/dd/yy")
Quang PT
Bebo
Thank you so much.
Hi Bebo
How to change this from A2 all the way down to the end of A column? The end of the column is 1048576. Do I change Range($A$2:$A$1048576)? I tried this but when I search, There was some skip rows. Thank you
ActiveSheet.Range("$A$2:$A$17")
I wouldn't advise asking any macro or formula to check over 1 million different cells.
Define a variable to identify the last used row.
Enter the following at the start of the macro after "Dim sFind";
Then change ActiveSheet.Range("$A$2:$A$17") to ActiveSheet.Range("$A$2:$A$" & LastRow)![]()
Please Login or Register to view this content.
Hi,
I think i did right :o( ....
Thank you so much
![]()
Please Login or Register to view this content.
Hi,
I want to search just by Month and Year.
My date setting in A:A example 03/09/23. But when I find or search all the month of March 2023 it does not do it.
I tried to to =Format(sFind, "mm/yy") but did not work.
Thank you
![]()
Please Login or Register to view this content.
Last edited by RJ1969; 03-10-2023 at 02:58 PM.
If you input like this in "mm/yy":
03/22
try
PHP Code:
Sub test()
Dim sFind, startD, endD
Dim LastRow As Long
LastRow = ActiveSheet.Cells(ActiveSheet.Rows.Count, "A").End(xlUp).Row
sFind = InputBox("Please enter search data", "Search Box", "")
If sFind = "" Then Exit Sub
startD = CDate("01/" & sFind)
endD = CDate(WorksheetFunction.EoMonth(startD, 0))
ActiveSheet.Range("$A$2:$A$" & LastRow).AutoFilter Field:=1, Criteria1:=">=" & startD, Operator:=xlAnd, Criteria2:="<=" & endD
Range("A12").Select
End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks