Hello everyone!
I ran following code on my data to remove Outline from my data and to filter non-blank rows and delete hidden/filtered rows.
I wanted to keep this code in personal macro workbook. Yesterday i tested this code in personal macro workbook and it worked fine.
Today i copied the same code in personal macro workbook, on execution i received the error noted in the subject. Need help on rectifying this error.
Another strange thing i noticed, in the below mentioned code, i wrote the code for removing the outline from my data but it does not get
executed even when it is written before "Autofilter Code" (as the error arises in "Autofilter" line of code). Does code written inside"With / End with" construct"
executes at once or line by line?
Sub FBL3N()
Dim sh As Worksheet
Dim r As Long
Dim LastRow As Long
Const StartRow As Long = 1
Set sh = ThisWorkbook.Worksheets("Sheet1")
Application.ScreenUpdating = False
sh.AutoFilterMode = False
With sh.Range("A1")
.ClearOutline
.AutoFilter Field:=1, Criteria1:="<>"
End With
'LastRow = sh.Cells(Rows.Count, "A").End(xlUp).Row
LastRow = sh.UsedRange.Rows.Count
For r = LastRow To StartRow Step -1
If Rows(r).Hidden = True Then
Rows(r).Delete
'Range("F" & r).Value = "X"
End If
Next r
Call Variant_Array1
Call Variant_Array2
sh.AutoFilterMode = False
Application.ScreenUpdating = True
End Sub
Any help would be highly appreciated
Thanks!
Bookmarks