Hi All
I am trying to filter by a range of values , but nothing happens. please help.
PS: howto Debug.Print a range (like workbook ..sheet ... A1:A100)
Debug.Print rngallean.Value
Debug.Print rng1.Value
I am trying to filter by a range of values , but nothing happens. please help.
PS: howto Debug.Print a range (like workbook ..sheet ... A1:A100)
Debug.Print rngallean.Value
Debug.Print rng1.Value
Code:
Dim template As String
template = ThisWorkbook.Name
Dim ltrw As Long
ltrw = Range("F" & Rows.Count).End(xlUp).Row
Dim rng1 As Range
Set rng1 = Range("F6:F" & ltrw)
Dim Ean As String
Workbooks.Open (Range("A1").Value & "EanCode.xlsx")
Ean = ActiveWorkbook.Name
Dim lastRow As Long
lastRow = Range("a" & Rows.Count).End(xlUp).Row
Dim rngallean As Range
Set rngallean = Range("A1:I" & lastRow)
[U][B] rngallean.AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:=rng1, Unique:=False[/B][/U]
' version 2
[U][B] Workbooks(Ean).Sheets("EanCode").Range("A1:I20000").AdvanceFilter Action:=xlFilterInPlace, CriteriaRange:= _
Workbooks(template).Sheets("Template").Range("F6:F1000"), Unique:=False[/B][/U]