Hello All
I have a list of 100000 numbers ordered in an ascending column
I am trying to write a formula to highlight (or just place 'yes' mark in an adjacent cell) every cell where the numerical value is x (the starting number in the ordered sequence) plus n (a value that could be changed).
So successive highlighted cells/rows are n higher than the last highlighted cell.
Please see the attached VBA code which I can make work until I try and rest the base value ("base1") from which I am trying to calculate the next n+12
Sub FindTP(InputValue, rng As Range)
Dim Cell As Range
Dim base1 As Integer
Dim TestValue As Integer
RunTP = "No"
base1 = InputValue
For Each Cell In rng
If Cell.Value > base1 + 12 Then
RunTP = "Yes"
base1 = Cell.Value
End If
Next Cell
End Function
End Sub
Any help to achieve this would be appreciated - the real number list to be analysed is 100000 long and so a laborious manual task otherwise.
Thanks in advance
KB
I have a list of 100000 numbers ordered in an ascending column
I am trying to write a formula to highlight (or just place 'yes' mark in an adjacent cell) every cell where the numerical value is x (the starting number in the ordered sequence) plus n (a value that could be changed).
So successive highlighted cells/rows are n higher than the last highlighted cell.
Please see the attached VBA code which I can make work until I try and rest the base value ("base1") from which I am trying to calculate the next n+12
Sub FindTP(InputValue, rng As Range)
Dim Cell As Range
Dim base1 As Integer
Dim TestValue As Integer
RunTP = "No"
base1 = InputValue
For Each Cell In rng
If Cell.Value > base1 + 12 Then
RunTP = "Yes"
base1 = Cell.Value
End If
Next Cell
End Function
End Sub
Any help to achieve this would be appreciated - the real number list to be analysed is 100000 long and so a laborious manual task otherwise.
Thanks in advance
KB