View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
jeannie v jeannie v is offline
external usenet poster
 
Posts: 127
Default Missing a command in this macro

Hi Expert....Thank you....yes it does work....I was adding the Auto Calc
Manual and Auto commands and I guess thatis goobering it up...When I use the
Macro as you did, it only does 1 row at a time...since I have 12000 rows, it
takes forever...I'm trying to get the Macro to go through the doc fast...Can
you give me any suggestions?

Sub DeleteLOATermedDupRecords()

Application.Calculation = xlCalculationManual
mc = "J"
r = Cells(Rows.Count, mc).End(xlUp).Row
For i = 1 To r
If Cells(i, "I") = "0" Then
If Cells(i, mc) = "LOA" _
Or Cells(i, mc) = "Termed" _
Or Cells(i, mc) = "Duplicate" Then
Rows(i).Delete
End If
End If
Next i
Application.Calculation = xlCalculationAutomatic
End Sub

I appreciate your expertise.....Thank you,
--
jeannie v


"FSt1" wrote:

hi
this works for me(several times) on a ten row test in xl2003...

mc = "J"
r = Cells(Rows.Count, mc).End(xlUp).Row
For i = 1 To r
If Cells(i, "I") = "0" Then
If Cells(i, mc) = "LOA" _
Or Cells(i, mc) = "Termed" _
Or Cells(i, mc) = "Duplicate" Then
Rows(i).Delete
End If
End If
Next i

regards
FSt1

"jeannie v" wrote:

Good Evening, Experts:

I want this macro to remove all Zero (as Text) in Column I for LOA, Termed
and Duplicate records in Column J...My macro is not working...can someone
tell me the commands to make this work. There is an error somewhere and I'm
not savvy enough to fix it.

Macro is:

Sub DeleteLOATermedDupRecords()

Application.Calculation = xlCalculationManual
mc = "J"
For i = Cells(Rows.Count, mc).End(xlUp).Row To 1 Step -1
If Cells(i, "I") = "0" Then
Cells(i, mc) = "LOA" Or Cells(i, mc) = "Termed" Or _
Cells(i, mc) = "Duplicate"
Rows(i).Delete
Next i
Application.Calculation = xlCalculationAutomatic
End Sub


Thank you for your help
--
jeannie v