Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
heres an easy one for y'all:
i have values in columns b and c from rows 5 to 600. i would like a program that checks each row such that if the value in column b is greater than column c, it deletes the values in that row (or deletes the row entirely) ill give you a better challenge next time, i swear... |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this one Lawson for the ActiveSheet
Sub Example2() Dim Lrow As Long Dim CalcMode As Long Dim StartRow As Long Dim EndRow As Long With Application CalcMode = .Calculation .Calculation = xlCalculationManual .ScreenUpdating = False End With With ActiveSheet .DisplayPageBreaks = False StartRow = 6 EndRow = 600 For Lrow = EndRow To StartRow Step -1 If .Cells(Lrow, "B").Value .Cells(Lrow, "C").Value _ Then .Rows(Lrow).Delete Next End With With Application .ScreenUpdating = True .Calculation = CalcMode End With End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Lawson" wrote in message ... heres an easy one for y'all: i have values in columns b and c from rows 5 to 600. i would like a program that checks each row such that if the value in column b is greater than column c, it deletes the values in that row (or deletes the row entirely) ill give you a better challenge next time, i swear... |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() -----Original Message----- heres an easy one for y'all: i have values in columns b and c from rows 5 to 600. i would like a program that checks each row such that if the value in column b is greater than column c, it deletes the values in that row (or deletes the row entirely) ill give you a better challenge next time, i swear... . Try this Sub TestVals() Dim rng As Range Dim c As Variant Set rng = Range(Cells(5, 2), Cells(500, 2)) For Each c In rng If c c.Offset(0, 1) Then c.EntireRow.Delete End If Next c End Sub Regards Peter |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
There must be an easy way? | Excel Discussion (Misc queries) | |||
pls help, is there an easy way to | Excel Worksheet Functions | |||
easy | Excel Worksheet Functions | |||
Easy one....Right? | Excel Discussion (Misc queries) | |||
new user with easy question? not easy for me | New Users to Excel |