Try this user defined function
Function SpotNegativeNumbers(MyRange As Range) As String
Dim N As Long
Dim HasNegative As Boolean
HasNegative = False
If MyRange.Offset(0, -1) = "DATA" Then
For N = 1 To MyRange.Row - 1
If Cells(N, 1) = "DATA" Then Exit For
If MyRange.Offset(-N, -1) < 0 Then
HasNegative = True
Exit For
End If
Next N
If HasNegative = True Then
SpotNegativeNumbers = "YES"
Else
SpotNegativeNumbers = "NO"
End If
End If
End Function
Open the VBA editor by hitting Alt F11.
Insert a new module with Insert - Module
Paste in the above function
Go back to the sheet by hitting Alt F11.
In a B1, enter =SpotNegativeNumbers(B1) and copy down
Remember to save the workbook as a macro enabled workbook .xlsm
Bookmarks