# Repeat formula

Solved/Closed
kyle - Mar 17, 2010 at 02:10 PM
KYLE - Mar 17, 2010 at 08:16 PM
Hello,
I need the the formula to work for every cell in column A. So if I select A1 and enter a number >= 40 it skips the next cell, and if I select A2 and enter a number >= 40 it skips the next cell, etc., until A446. This formula works on the first cell, but I do not know how to make it repeat.
Thank you for any help,
Kyle

Sub skipcell()

If Range("\$A1") >= 40 Then
Range("\$A3").Select

Else
If Range("\$A1") < 40 Then
Range("\$A2").Select
End If
End If

End Sub

Private Sub Worksheet_Change(ByVal Target As Range)

Call skipcell

End If
End Sub

rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 767
Mar 17, 2010 at 04:42 PM
Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Column <> 1 then exit sub

myrow = target.row

if myrow>446 then exit sub

Application.EnableEvents = False

if (target.value >=40) then

cells(myrow+2, "A").select

else
cells(myrow+1, "A").select

End If

Application.EnableEvents = true

End Sub
THAT WORKS GREAT. THANK YOU SO MUCH!!!!