Select Case – Active Cell Delete

Hi, I have written some code to loop down a column in a spreadsheet and test for case is >0.001, this works when the cell value is greater than 0.5, however for anything less I am getting a Run time error ‘1004’ : Appliocation defined or object defined error. Can anyone help?

My code is below

Option Explicit

Sub TimeFilter()

Application.ScreenUpdating = False
Application.DisplayStatusBar = True

Dim Time As Single
Dim a As Integer

Application.StatusBar = “Performing Time Filter…”
Range(“F7”).Select ‘ select active cell – time difference

Do
a = ActiveCell.Row

Time = ActiveCell.Value
Select Case Time

Case Is > 0.001 ‘ test active cell for time filter
Range(ActiveCell, Cells(ActiveCell.Row + 119, ActiveCell.Columns)).Delete ‘ if condition is met delete active cell and 120 rows below
Selection.Cells(1, 1).Activate

Case Else
ActiveCell.Offset(1, 0).Select ‘ moves to next row if condition above is not met
End Select

Loop Until a = 10090

Application.StatusBar = False
Application.ScreenUpdating = True

End Sub

 

 

 

By: Sam Tetley

386 thoughts on “Select Case – Active Cell Delete

  1. for more info

    I think other web site proprietors should take this web site as an model, very clean and magnificent user genial style and design, let alone the content. You are an expert in this topic!

  2. tattoo studio

    This awesome blog is no doubt educating additionally factual. I have found a lot of useful stuff out of this amazing blog. I ad love to return over and over again. Thanks a bunch!

  3. 토토매니아

    I was recommended this blog by my cousin. I am not sure whether this post is written by him as nobody else know such detailed about my difficulty. You are amazing! Thanks!

  4. Short Haircuts

    Short haircuts, Have a peek at the latest on-trend short hairstyles and short sassy haircuts, flattering both straight and curly hair and ideal for any time of year on. Short hair refers to any haircut with little length. It may vary from above the ears to below the chin. If a man’s hair reaches the chin, it may not be considered short. For a woman, however, short varies from close-cropped to just above the shoulders.

  5. Short Haircuts

    Short haircuts, Have a peek at the latest on-trend short hairstyles and short sassy haircuts, flattering both straight and curly hair and ideal for any time of year on. Short hair refers to any haircut with little length. It may vary from above the ears to below the chin. If a man’s hair reaches the chin, it may not be considered short. For a woman, however, short varies from close-cropped to just above the shoulders.

  6. Kulit Wajah Dengan Serum

    Do a person have a spam matter on this website; My partner and i also am a tumblr, and I planned to understand your situation; many involving us are suffering from some wonderful methods, and that we are looking to be able to trade methods with some others, why not shoot me personally an e-mail if fascinated.

  7. ig

    It is perfect time to make a few plans for the longer term and it’s time to be happy.
    I have read this submit and if I may just I wish to suggest you some attention-grabbing things or
    advice. Perhaps you can write subsequent articles referring to
    this article. I want to read even more issues approximately it!

  8. Kho Sim

    This unique blog is really awesome and also factual. I have found helluva interesting tips out of this source. I ad love to return over and over again. Cheers!

  9. Anzzi

    terrific website But wanna state which kind of is traditionally genuinely useful, Regards to consider your time and effort you should this program.

  10. Short Haircuts for Women Under 25

    Short Haircuts for Women Under 25, Have a peek at the latest on-trend short hairstyles and short sassy haircuts, flattering both straight and curly hair and ideal for any time of year on. There’s no going back once you commit to the short hairstyle—so how are you supposed to style it once you do? These easy-to-manage short hairstyles for women are exactly what you need to amp up your usual routine. Looking for new ways to up your hair volume? Check out these ultimate volume- boosting short hairstyles for fine hair!

  11. Short Haircuts for Women Under 25

    Short Haircuts for Women Under 25, Have a peek at the latest on-trend short hairstyles and short sassy haircuts, flattering both straight and curly hair and ideal for any time of year on. There’s no going back once you commit to the short hairstyle—so how are you supposed to style it once you do? These easy-to-manage short hairstyles for women are exactly what you need to amp up your usual routine. Looking for new ways to up your hair volume? Check out these ultimate volume- boosting short hairstyles for fine hair!

  12. Short Hair cuts

    Short Haircuts, Have a peek at the latest on-trend short hairstyles and short sassy haircuts, flattering both straight and curly hair and ideal for any time of year on. There’s no going back once you commit to the short hairstyle—so how are you supposed to style it once you do? These easy-to-manage short hairstyles for women are exactly what you need to amp up your usual routine. Looking for new ways to up your hair volume? Check out these ultimate volume- boosting short hairstyles for fine hair!

  13. Brookwood Camps

    I’m not sure where you’re getting your information, but great
    topic. I needs to spend some time learning more or understanding more.
    Thanks for great info I was looking for this info for my mission.

Comments are closed.