I'd like to ask some help about my code below. This is captured using the macro recorder after importing the file. Basically, I imported the a text file and after importing the file to the Excel (macro begins) I delete the rows 10-12 and auto filter it which is works. (macro stop)
After that, I want to delete all the empty/blank rows from A10-onwards. So I added the code (under "'ADDED to DELETE ROWS"
).
What I need is to delete the all the rows with "TEST", delete all the blank rows and filter the first rows.
The first part of the code is working, but to delete the blank rows didn't work. Can you please help me to identify what wrong with my code below. Please click the link to show result (before and after).
Thank you and appreciate your help.
Sub Macro2()
Rows("10:12").Select
Selection.Delete Shift:=xlUp
Selection.AutoFilter
'ADDED to DELETE ROWS
'Worksheets("Sheet1").Activate
On Error Resume Next
With Range("A10:A")
.Value = .Value
.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End With
End Sub
Regards,wezzer