Repeat formula

Solved/Closed
Report
-
 KYLE -
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)


If Target.Address = "$A$1" Then

Call skipcell

End If
End Sub

1 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
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
0
THAT WORKS GREAT. THANK YOU SO MUCH!!!!
0