View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary Keramidas[_2_] Gary Keramidas[_2_] is offline
external usenet poster
 
Posts: 364
Default Two situations in the same column

see if this will work for you

Option Explicit
Dim mg As Range
Dim LastRow As Long
Dim TestFor As Long
Dim cell As Range
Dim CurRow As Range
Sub test()
LastRow = Range("a1").End(xlDown).Row
Set mg = Range("a1:a" & LastRow)
On Error Resume Next
If Not mg Is Nothing Then

For Each cell In mg
Set CurRow = Range("a" & LastRow)
If Range("A" & LastRow).Value < 0 Then
Range("M" & LastRow) = Range("a" & LastRow).Value
With CurRow.Offset(0, 12)
..Interior.ColorIndex = 37
End With
End If
Set CurRow = Range("a" & LastRow)
If Range("A" & LastRow).Value 5000 Then
Range("M" & LastRow) = Range("a" & LastRow).Value
With CurRow.Offset(0, 12)
..Interior.ColorIndex = 37
End With
End If

LastRow = LastRow - 1
Next cell
Else
End If

End Sub


--


Gary


"Steved" wrote in message
...
Hello from Steved

In Column D1:D1000 I put in Kilometres
What had happened a figure 124,957 was A mistake

I would like to know please if the below is possble Thankyou.

In Column D1:D1000 if the figure is a minus or greater than 5,000
I need to know, I am thinking that in Cell M1 if the above occurs then
true
if not it will read normally False, also in D1:D1000 can the cell be
highlighted
maybe the cell background be Blue if not then in Cell M2, M3 and so on to
inform me where the mistakes are. if the above is not possible would you
give me some sugguestions please.

Thankyou for your time on my issue.