Forum Discussion
anolinde
Jan 13, 2021Copper Contributor
VBA Error (but only on one sheet): Object variable or With block variable not set
I'm using Excel in Microsoft Office 365 on Windows 10. I've been using a macro to sort two tabs on my spreadsheet, which are identical in format, and after months of working perfectly, now the macro ...
HansVogelaar
Jan 13, 2021MVP
On a sheet where the original code worked, you'll see filter arrows in the cells in row 1:
If you don't see those arrows, Filter hasn't been turned on and the code will fail. The lines that I suggested will turn on the filter arrows (it's the equivalent of selecting Sort & Filter > Filter on the Home tab of the ribbon)
ā
anolinde
Jan 13, 2021Copper Contributor
HansVogelaar Thank you for explaining! That's interesting, I actually do have the filters turned on in both tabs of the spreadsheet. So I'm not sure why it wasn't working... but either way, your solution fixed it! Thanks again, I appreciate it.
Edit - or maybe your code fixed it *facepalm* Anyway, I'll pay closer attention to this going forward!