Hi Everyone,
Good Day to you all.
I'm in need of assistance regarding a particular problem of autofiltering..
The below code, filters a specific column and extract the data..
However, the file that I'm extracting is protected and already filtered and there's no way to obtain the password.
My question is it is possible to just extract the information and tell my codes that file is already filtered? I mean, how to modify my codes base on my scenario?
Thanks in Advance guys.
I'm getting an error of this line
Good Day to you all.
I'm in need of assistance regarding a particular problem of autofiltering..
The below code, filters a specific column and extract the data..
However, the file that I'm extracting is protected and already filtered and there's no way to obtain the password.
My question is it is possible to just extract the information and tell my codes that file is already filtered? I mean, how to modify my codes base on my scenario?
Thanks in Advance guys.
I'm getting an error of this line
VBA Code:
.Range("B8").CurrentRegion.AutoFilter _
Field:=1, Criteria1:=">=" & CLng(startDate), _
Operator:=xlAnd, Criteria2:="<=" & CLng(endDate)
VBA Code:
Set colFiles = GetMatches(START_FOLDER, "*.xlsx*") '<< ###fixed
For Each f In colFiles
Set fromWorkbook = Workbooks.Open(f, ReadOnly:=True)
With fromWorkbook.Worksheets(1)
.Range("B8").CurrentRegion.AutoFilter _
Field:=1, Criteria1:=">=" & CLng(startDate), _
Operator:=xlAnd, Criteria2:="<=" & CLng(endDate)
.Range("B8").CurrentRegion.Offset(IIf(destCell.Row = 1, 0, 1)).Copy destCell
End With
fromWorkbook.Close False
With destCell.Worksheet
Set destCell = .Cells(.Rows.Count, "B").End(xlUp).Offset(1)
End With
Next f
MsgBox "Finished"
End Sub