1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Excel VB script to delete row after a certain time

Discussion in 'Business Applications' started by kdorsainvil, Feb 18, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. kdorsainvil

    kdorsainvil Thread Starter

    Joined:
    Feb 18, 2011
    Messages:
    1
    I am currently using excel to display some information. I was hoping someone can help me out with a VB script. I am trying to create a script that will check the current time. If the current time is greater than a time in a cell, then it should delete the row.
    Thanks in advance for the help
     
  2. falconMM

    falconMM

    Joined:
    Feb 2, 2010
    Messages:
    29
    You should go to Mr. Excel. You'll get an answer within a couple of minutes there. You never know how long this answer could take :)
     
  3. Zack Barresse

    Zack Barresse

    Joined:
    Jul 25, 2004
    Messages:
    5,447
    Hi there, welcome to the board!

    Meeting your specs...

    Code:
    Sub CheckTimeAgainstCellValue()
        With ThisWorkbook.Sheets("Sheet1")
            If VBA.Time > .Range("A1").Value Then
                .Rows(1).Delete
            End If
        End With
    End Sub
    If you want it more dynamic than that, you'll have to provide more details. Please be as specific as possible.

    @falconMM: I would recommend that if you're going to promote other boards, you follow it up with recommendations for cross-posting. I.e. http://www.excelguru.ca/node/7.
     
  4. Cookiegal

    Cookiegal Administrator Malware Specialist Coordinator

    Joined:
    Aug 27, 2003
    Messages:
    101,669
    Since you are now being helped elsewhere, I'm closing this thread.

    falconmm,

    In the future, please do not direct users who come here for assistance away to other sites.
     
  5. Cookiegal

    Cookiegal Administrator Malware Specialist Coordinator

    Joined:
    Aug 27, 2003
    Messages:
    101,669
    Sorry, Zack. I hadn't seen your post so I won't close it but do you wish to continue here even though he's also receiving assistance elsewhere?
     
  6. Zack Barresse

    Zack Barresse

    Joined:
    Jul 25, 2004
    Messages:
    5,447
    Not entirely. I don't like nor appreciate cross-posting. It becomes futile and frustrating. Thanks though. :)
     
  7. Cookiegal

    Cookiegal Administrator Malware Specialist Coordinator

    Joined:
    Aug 27, 2003
    Messages:
    101,669
    That's what I thought too so I'll close it. :)
     
  8. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/981471