J
jeremiah
I have just one thing that is stumping me. I have modified Ron Debruin code
to go
accross multiple columns but there are certain columns that I get a Run Time
Error 13, Type Mismatch error on. I have column A through K, which are just
general numbers, about every other column has up to 2 decimal places. Those
columns with decimals are where I am getting the run time error. If I do not
incorporate those columns, then the macro runs perfectly.
Sub Loop_Example4()
Dim Firstrow As Long
Dim LastRow As Long
Dim Lrow As Long
Dim CalcMode As Long
Dim ViewMode As Long
Dim rng As Range
Dim rngColour As Range
Dim blnColour As Boolean
With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With
With ActiveSheet
.Select
ViewMode = ActiveWindow.View
ActiveWindow.View = xlNormalView
.DisplayPageBreaks = False
Firstrow = 2
LastRow = .UsedRange.Rows(.UsedRange.Rows.Count).Row
For Lrow = LastRow To Firstrow Step -1
If .Cells(Lrow, "c").Value <> "No" And _
.Cells(Lrow, "e").Value <> "No" And _
.Cells(Lrow, "g").Value <> "No" And _
.Cells(Lrow, "i").Value <> "No" And _
.Cells(Lrow, "j").Value <> "No" And _
.Cells(Lrow, "k").Value <> "No" Then .Rows(Lrow).Delete
Next Lrow
End With
ActiveWindow.View = ViewMode
With Application
.ScreenUpdating = True
.Calculation = CalcMode
End With
End Sub
to go
accross multiple columns but there are certain columns that I get a Run Time
Error 13, Type Mismatch error on. I have column A through K, which are just
general numbers, about every other column has up to 2 decimal places. Those
columns with decimals are where I am getting the run time error. If I do not
incorporate those columns, then the macro runs perfectly.
Sub Loop_Example4()
Dim Firstrow As Long
Dim LastRow As Long
Dim Lrow As Long
Dim CalcMode As Long
Dim ViewMode As Long
Dim rng As Range
Dim rngColour As Range
Dim blnColour As Boolean
With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With
With ActiveSheet
.Select
ViewMode = ActiveWindow.View
ActiveWindow.View = xlNormalView
.DisplayPageBreaks = False
Firstrow = 2
LastRow = .UsedRange.Rows(.UsedRange.Rows.Count).Row
For Lrow = LastRow To Firstrow Step -1
If .Cells(Lrow, "c").Value <> "No" And _
.Cells(Lrow, "e").Value <> "No" And _
.Cells(Lrow, "g").Value <> "No" And _
.Cells(Lrow, "i").Value <> "No" And _
.Cells(Lrow, "j").Value <> "No" And _
.Cells(Lrow, "k").Value <> "No" Then .Rows(Lrow).Delete
Next Lrow
End With
ActiveWindow.View = ViewMode
With Application
.ScreenUpdating = True
.Calculation = CalcMode
End With
End Sub