The code below is meant to run when the Workbook is first opened.
Sub Auto_Open()
Dim LastRow As Integer
LastRow = Sheet6.UsedRange.Rows.Count
ActiveWorkbook.RefreshAll
Sheet6.AutoFill Destination:=Range("Y2:Y" & LastRow)
End Sub
It automatically runs a Refresh All to update any queries or formula in the WorkBook and then autofills the list of data in column Y of sheet6 to the last row of data that can be found in the WorkSheet.
When I go to run the code I get a 'Compile Error: Method of data member not found' which highlights.
.Autofill
What I don't understand is that this works perfectly well on an identical spreadsheet, not just this one.
I have also tried the following code which doesn't work on this sheet but does on the other.
Sub Auto_Open()
ActiveWorkbook.RefreshAll
Sheet6.AutoFill_ListSource
End Sub
ListSource is the name of the table in column Y that I am trying to autofill.