Hi,
i am facing a problem with this code, when i try to find the date& time format (dd/mm/yyyy hh:mm) . code is not finding the dd/mm/yyyy hh:mm .
i am trying to give input and find the value in the excel to delete the entire rows and delete rows after to it. But i can't make it.
Please help me to move forward
code i have used:
Sub FindValue_DeleteRows()
Dim LastRow As Long, FindMe As String, FoundText As Range
FindMe = Application.InputBox("Enter Value to find", Type:=2)
On Error Resume Next
Set FoundText = Cells.Find(FindMe, Cells.SpecialCells(xlCellTypeLastCell), xlValues, xlWhole, xlRows, xlNext, True)
If Not FoundText Is Nothing Then
LastRow = Cells.Find(What:="*", SearchOrder:=xlRows, SearchDirection:=xlPrevious, LookIn:=xlFormulas).Row
Range(FoundText.Row & ":" & LastRow).Delete
End If
On Error GoTo 0
End Sub
Regards,
Dinesh
Why dont you attach the sample workbook that you are using the code with?
Cheers,
Arlette
If I helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
Please find the attached workbook....
I dont see any data having date & time format in your example sheet. Also, is it necessary that the time should also be searched? Wont just the date suffice? When the date is found, what cells need to be deleted?
Cheers,
Arlette
If I helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks