Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 519
Default Two situations in the same column

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default Two situations in the same column

sorry, forgot your data was in column D

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("D1").End(xlDown).Row
Set mg = Range("D1:D" & LastRow)
On Error Resume Next
If Not mg Is Nothing Then

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

LastRow = LastRow - 1
Next cell
Else
End If

End Su

--


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.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 519
Default Two situations in the same column

Hello Gary from Steved

Firstly thankyou.

Gary I am getting a Complie error Syntax error on the line below.

...Interior.ColorIndex = 37

Is their something I should be doing to avoid this error yes I've put it in
the same worksheet, Personal.xls!test

"Gary Keramidas" wrote:

sorry, forgot your data was in column D

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("D1").End(xlDown).Row
Set mg = Range("D1:D" & LastRow)
On Error Resume Next
If Not mg Is Nothing Then

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

LastRow = LastRow - 1
Next cell
Else
End If

End Su

--


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.




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default Two situations in the same column

steve:
go ahead and email me so i can send you something back

--


Gary


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

Firstly thankyou.

Gary I am getting a Complie error Syntax error on the line below.

..Interior.ColorIndex = 37

Is their something I should be doing to avoid this error yes I've put it
in
the same worksheet, Personal.xls!test

"Gary Keramidas" wrote:

sorry, forgot your data was in column D

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("D1").End(xlDown).Row
Set mg = Range("D1:D" & LastRow)
On Error Resume Next
If Not mg Is Nothing Then

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

LastRow = LastRow - 1
Next cell
Else
End If

End Su

--


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.








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 519
Default Two situations in the same column

Thankyou Gary I've done as you requested.

"Gary Keramidas" wrote:

steve:
go ahead and email me so i can send you something back

--


Gary


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

Firstly thankyou.

Gary I am getting a Complie error Syntax error on the line below.

..Interior.ColorIndex = 37

Is their something I should be doing to avoid this error yes I've put it
in
the same worksheet, Personal.xls!test

"Gary Keramidas" wrote:

sorry, forgot your data was in column D

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("D1").End(xlDown).Row
Set mg = Range("D1:D" & LastRow)
On Error Resume Next
If Not mg Is Nothing Then

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

LastRow = LastRow - 1
Next cell
Else
End If

End Su

--


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.






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default Two situations in the same column

it looks like there ma be an extra period in front. make sure there is only
1

..Interior.ColorIndex = 37
--


Gary


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

Firstly thankyou.

Gary I am getting a Complie error Syntax error on the line below.

..Interior.ColorIndex = 37

Is their something I should be doing to avoid this error yes I've put it
in
the same worksheet, Personal.xls!test

"Gary Keramidas" wrote:

sorry, forgot your data was in column D

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("D1").End(xlDown).Row
Set mg = Range("D1:D" & LastRow)
On Error Resume Next
If Not mg Is Nothing Then

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

LastRow = LastRow - 1
Next cell
Else
End If

End Su

--


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.






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting for multiple situations Lisa Excel Worksheet Functions 3 March 22nd 10 07:19 PM
Various dates returned for variable situations, + Steve Excel Worksheet Functions 0 June 9th 09 06:01 PM
work customizable situations problem jimtmcdaniels Setting up and Configuration of Excel 0 March 28th 07 06:32 AM
conflicitng situations in shared workbook Olivier Excel Discussion (Misc queries) 0 April 26th 06 10:49 AM
Multiple IF situations K.W.Martens Excel Programming 8 January 6th 05 11:47 PM


All times are GMT +1. The time now is 04:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"