jbesclapez
Active Member
- Joined
- Feb 6, 2010
- Messages
- 275
Hello,
I am using this code now to filter on 7 columns and delete the entire row if cell is empty.
But it takes too long... can you fix it or point me to the right code? I noticed the problem is when it reachers Selection.Delete Shift:=xlUp
Thanks
I am using this code now to filter on 7 columns and delete the entire row if cell is empty.
But it takes too long... can you fix it or point me to the right code? I noticed the problem is when it reachers Selection.Delete Shift:=xlUp
Thanks
Code:
Sub FilterAndDeleteEmptyLines()
'
' Macro3 Macro
'
' Cells.Select
' Selection.ClearContents
'Application.ScreenUpdating = False
'Application.DisplayAlerts = False
Sheets("Sheet3").Select
Columns("A:J").Select
Selection.Copy
Sheets("TabWord").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Columns("H:H").Select
Application.CutCopyMode = False
Selection.TextToColumns Destination:=Range("H1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:="#", FieldInfo:=Array(Array(1, 2), Array(2, 2)), TrailingMinusNumbers:=True
Range("I1").Select
ActiveCell.FormulaR1C1 = "NumWord"
Columns("A:J").Select
Range("J1").Activate
Selection.AutoFilter
ActiveSheet.Range("$A$1:$J$998").AutoFilter Field:=1, Criteria1:="="
ActiveSheet.Range("$A$1:$J$998").AutoFilter Field:=2, Criteria1:="="
ActiveSheet.Range("$A$1:$J$998").AutoFilter Field:=3, Criteria1:="="
ActiveSheet.Range("$A$1:$J$998").AutoFilter Field:=4, Criteria1:="="
ActiveSheet.Range("$A$1:$J$998").AutoFilter Field:=5, Criteria1:="="
ActiveSheet.Range("$A$1:$J$998").AutoFilter Field:=6, Criteria1:="="
ActiveSheet.Range("$A$1:$J$998").AutoFilter Field:=7, Criteria1:="="
Rows("2:20000").Select
Selection.Delete Shift:=xlUp
ActiveWindow.SmallScroll Down:=-15
Columns("A:J").Select
Selection.AutoFilter
Range("A1").Select
Sheets("Sheet3").Select
Range("AO1").Select
' Application.ScreenUpdating = True
' Application.DisplayAlerts = True
End Sub