Hi all,
In the code below I want to adjust the "criteria" line in such a way that it not refers to an array, but that it refers to a range in column A that is changing in size (sometimes it has more, sometimes it less lines) on a separate sheet (Sheet3)
How do I make this adjustment? I know that criteria should be set as range instead of variant and tried a few other things but I'm a bit stuck
Thanks in advance.
In the code below I want to adjust the "criteria" line in such a way that it not refers to an array, but that it refers to a range in column A that is changing in size (sometimes it has more, sometimes it less lines) on a separate sheet (Sheet3)
How do I make this adjustment? I know that criteria should be set as range instead of variant and tried a few other things but I'm a bit stuck
VBA Code:
Sub Seperate_Sheets()
Dim sheetsToFsilter As Variant, sheetsColumnToFilterOn As Variant
Dim criteria As Variant, criterium As Variant
Dim iSht As Long
Dim pre As String
Dim wb1 As Workbook, wb2 As Workbook
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Set wb1 = ThisWorkbook
sheetsToFilter = Array("Sheet1", "Sheet2")
sheetsColumnToFilterOn = Array(20, 24)
criteria = Array("Name1", "Name2")
pre = Format(DateAdd("M", -1, Now), "mmmm")
Thanks in advance.