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

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. Baixar Lista Iptv Junho 2020

    Ponto IPTV a melhor programacao de canais IPTV do Brasil, filmes, series, futebol, lutas, shows, documentarios em alta definicao de imagem e som em SD, HD, FULL HD, 4K. compativel com todos aparelhos do mercado Brasileiro.

  2. jasa penulisan artikel

    Hi. I know this will be somewhat off-topic, but My partner and i was wondering in the event you recognized where I could have a captcha plugin for my personal comment form? I’m while using same blog platform such as yours, and I’m getting difficulty finding one? Many thanks.


    Woah! I’m enjoying the template/theme of this website. Is actually simple, yet effective. A new lot of times it is quite hard to get that will “perfect balance” between excellent usability and visual charm. I must say you might have done a very great job on this.

  4. Informasi Wisata

    Do an individual have a spam concern on this website; We also am a tumblr, and I desired to recognize your situation; many involving us are suffering from some great methods, and are looking in order to trade methods with other folks, why not shoot us an e-mail if curious.

  5. mobile web design

    I would like to thank you for the efforts you have put in writing this blog. I’m hoping to view the same high-grade content by you in the future as well. In fact, your creative writing abilities has motivated me to get my own, personal blog now 😉

  6. Tomoko

    It is hard to uncover knowledgeable individuals with this topic, nonetheless you look like there as extra that you are referring to! Thanks

  7. Kate

    Thank you, I ave just been looking for information about this subject for ages and yours is the greatest I ave discovered till now. But, what about the conclusion? Are you sure about the source?

  8. supplier vinyl lantai

    Hello! It is my initial visit to your site! All of us are a team associated with volunteers and starting a brand new initiative in a group inside the same niche. The blog provided us helpful information to operate on. An individual have done a superb work.

Comments are closed.