Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Counting for multiple situations | Excel Worksheet Functions | |||
Various dates returned for variable situations, + | Excel Worksheet Functions | |||
work customizable situations problem | Setting up and Configuration of Excel | |||
conflicitng situations in shared workbook | Excel Discussion (Misc queries) | |||
Multiple IF situations | Excel Programming |