+ Reply to Thread
Results 1 to 4 of 4

Thread: find date&time then delete rows after that.

  1. #1
    Registered User
    Join Date
    02-08-2012
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    4

    Unhappy find date&time then delete rows after that.

    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

  2. #2
    Forum Moderator arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    4,385

    Re: find date&time then delete rows after that.

    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]

  3. #3
    Registered User
    Join Date
    02-08-2012
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: find date&time then delete rows after that.

    Please find the attached workbook....
    Attached Files Attached Files

  4. #4
    Forum Moderator arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    4,385

    Re: find date&time then delete rows after that.

    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]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0