J
Jacob
I have a macro to run right before the workbook closes. It is as
follows:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Range("A1").Select
ActiveSheet.ShowAllData
ActiveWorkbook.Save
End Sub
The top row has the autofilter on. If the data is not filtered then
when the macro runs it throws a Run Time Error '1004'. If it is
filtered the Macro runs fine.
I can't seems to find the right code to get the macro to end if it
errors out. I think it would be an if then statement but my coding
skills aren't quite up the par.
Any help would be great. Thanks in advance.
Jacob
follows:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Range("A1").Select
ActiveSheet.ShowAllData
ActiveWorkbook.Save
End Sub
The top row has the autofilter on. If the data is not filtered then
when the macro runs it throws a Run Time Error '1004'. If it is
filtered the Macro runs fine.
I can't seems to find the right code to get the macro to end if it
errors out. I think it would be an if then statement but my coding
skills aren't quite up the par.
Any help would be great. Thanks in advance.
Jacob