I have some simple code that has worked for many years to fix the used range within a sheet after deleting a bunch of rows. Now it doesn't seem to work anymore. It was working through Excel 2013 but now that I'm using Excel 365, it has stopped working.
Code:
Sub FixUsedRange()
If ActiveSheet Is Nothing Then
MsgBox "Can't run without an active sheet."
Else
With ActiveSheet
.UsedRange
End With
End If
End Sub