I write macros to automate workflow at work. My current macro must select the first visible row of filtered data. I tested this code at home on the same version of Excel (16), and it worked fine. However, it gives me [Run-time error code '1004': Unable to get the SpecialCells property of the Range class] when I try it at work.
I have checked to make sure the formatting is the same between books. The data size of the testing book is larger than the at-work book. Since the code works at home with the same version of Excel, I am not sure what could be causing the discrepancy. This is the code that I am using.
Sub First_Visible_Cell()
With Worksheets("Items").AutoFilter.Range
Range("A" & .Offset(1, 0).SpecialCells(xlCellTypeVisible)(1).Row).Select
End With
End Sub