I think you may have to copy the filtered cells to their own contiguous ranges. Advanced filter will do this for you easily.
The following worked here:
Clear the Regression Output sheet completely (because I use .currentregion later) before running the macro.
Run this code:
LR1 = Sheets("Regression Data").Range("C" & Rows.Count).End(xlUp).Row ' determine extent of source data
'(note that I only use LR1 becuse if your LR2 is different from LR1 I suspect there will be a problem with the regression tool)
'Create a new table of filtered data; note that cell D3 of the Input sheet will need to be the same as the header in cell A1 of the Regression Data sheet.
Sheets("Regression Data").Range("A1:O" & LR1).AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheets("Input").Range("D3:D4"), _
CopyToRange:=Sheets("Regression Output").Range("A1"), Unique:=False
Set NewTableRange = Sheets("Regression Output").Range("A1").CurrentRegion 'find the extent of the new filtered data:
Set YValsRange = Intersect(NewTableRange, Sheets("Regression Output").Range("O:O")) 'find y values range
Set YValsRange = Intersect(YValsRange, YValsRange.Offset(1)) 'exclude the headers
Set XValsRange = Intersect(NewTableRange, Sheets("Regression Output").Range("C:M")) 'find x values range
Set XValsRange = Intersect(XValsRange, XValsRange.Offset(1)) 'exclude the headers
'Use the regression tool:
Application.Run "ATPVBAEN.XLAM!Regress", YValsRange, XValsRange, False, False, , Sheets("Regression Output").Range("$R$1"), False, False, False, False, , False
The results go to cell R3 of the Regression Output sheet.
Please check out the comments in the code too.
Of course, each time you could create a temporary new sheet to accommodate the new filtered table, put the regression data where you like on the Regression Output sheet, then delete that new sheet.