E
Esrei
This is the whole macro:
My range is A3500
I want to delete the row if the value in D is 0
At the moment I get a "Tipe mismatch" error
Please help????
Sheets("SALES SUMMARY").Select
Sheets("SALES SUMMARY").Copy After:=Sheets(26)
Range("A3:M571").Select
Selection.Copy
ActiveWindow.SmallScroll Down:=-15
Range("A3").Select
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
Columns("A:A").Select
Selection.Delete Shift:=xlToLeft
Columns("C:J").Select
Selection.Delete Shift:=xlToLeft
Columns("E:K").Select
Selection.Delete Shift:=xlToLeft
Range("F10").Select
Dim lastrow As Long
Dim row_index As Long
Application.ScreenUpdating = False
lastrow = ActiveSheet.Cells(Rows.Count, "D").End(xlUp).Row
For row_index = lastrow - 1 To 1 Step -1
If Cells(row_index, "D").Value = 0 Then
Rows(row_index).Delete
End If
Next
Application.ScreenUpdating = True
End Sub
..
My range is A3500
I want to delete the row if the value in D is 0
At the moment I get a "Tipe mismatch" error
Please help????
Sheets("SALES SUMMARY").Select
Sheets("SALES SUMMARY").Copy After:=Sheets(26)
Range("A3:M571").Select
Selection.Copy
ActiveWindow.SmallScroll Down:=-15
Range("A3").Select
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
Columns("A:A").Select
Selection.Delete Shift:=xlToLeft
Columns("C:J").Select
Selection.Delete Shift:=xlToLeft
Columns("E:K").Select
Selection.Delete Shift:=xlToLeft
Range("F10").Select
Dim lastrow As Long
Dim row_index As Long
Application.ScreenUpdating = False
lastrow = ActiveSheet.Cells(Rows.Count, "D").End(xlUp).Row
For row_index = lastrow - 1 To 1 Step -1
If Cells(row_index, "D").Value = 0 Then
Rows(row_index).Delete
End If
Next
Application.ScreenUpdating = True
End Sub
..