Re: Macro not working.



I need to now add a routine to also evaluate another column

I see you only keep the NCG rows now
If .Value <> "NCG" Then .EntireRow.Delete

Do you want to check for more values in the same column or in other columns ?
Which columns and which values ?

Give more information please



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"S Himmelrich" <himmelrich@xxxxxxxxx> wrote in message news:1194371958.421917.148850@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I've come accross another question for you. In regards to the
evaluating a row in a column and then identifying if it should be
deleted I'm now looking to evaluate column I and remove any row that
reflects "861126" or "861444" as well....can this be done within the
same loop? I tried copying the same code and changing values, but I
get compile errors as the varibles are already used / defined.....and
so forth...

For Lrow = Lastrow To Firstrow Step -1

'We check the values in the M column in this example
With .Cells(Lrow, "M")

If Not IsError(.Value) Then

If .Value <> "NCG" Then .EntireRow.Delete
'This will delete each row that doesn't have a
Value "NCG"
'in Column M, case sensitive.

End If

End With

Next Lrow

.



Relevant Pages

  • Re: Deleting Rows Problem
    ... Dim Firstrow As Long ... Dim LastRow As Long ... Dim Lrow As Long ...
    (microsoft.public.excel.programming)
  • Re: Deleting Rows Problem
    ... Dim Firstrow As Long ... Dim LastRow As Long ... Dim Lrow As Long ...
    (microsoft.public.excel.programming)
  • Re: Deleting Rows Problem
    ... Dim Firstrow As Long ... Dim LastRow As Long ... Dim Lrow As Long ...
    (microsoft.public.excel.programming)
  • Re: Deleting Rows Problem
    ... Dim Firstrow As Long ... Dim LastRow As Long ... Dim Lrow As Long ...
    (microsoft.public.excel.programming)
  • Re: Deleting Rows Problem
    ... Dim Firstrow As Long ... Dim LastRow As Long ... Dim Lrow As Long ...
    (microsoft.public.excel.programming)

Loading