Edgarvelez
Board Regular
- Joined
- Jun 6, 2019
- Messages
- 197
- Office Version
- 2016
- Platform
- Windows
Hi all,
Cant quite figure this one out how to write the last line, I ma not writing it correctly.
I am filtering in sh2 based on sh1.
Cant quite figure this one out how to write the last line, I ma not writing it correctly.
I am filtering in sh2 based on sh1.
VBA Code:
Dim sh1 As Worksheet, sh2 As Worksheet
Set sh1 = Sheets("DashBoard")
Set sh2 = Sheets("Sheet1")
Select Case sh1.Range("B3").Value
Case "Sheet Line No."
Dim Ary As Variant
With sh1.Range("A7", .Range("A" & Rows.Count).End(xlUp))
Ary = .Worksheet.Evaluate("transpose(if({1}," & .Address & "&""""))")
End With
End With
Sh2.("Sh1.Range("A2:G2").AutoFilter 1, Ary, xlFilterValues
End Sub