masud8956
Board Regular
- Joined
- Oct 22, 2016
- Messages
- 163
- Office Version
- 2016
- 2011
- 2007
- Platform
- Windows
Hi everyone,
I am using the following code to clear a certain data field. I am applying the code with a button and it worked for a few days but now I am getting an error msg.
What could have gone wrong and how to debug it?
Regards
I am using the following code to clear a certain data field. I am applying the code with a button and it worked for a few days but now I am getting an error msg.
VBA Code:
Sub ClearMe()
Application.ScreenUpdating = False
Sheets("DATA").Visible = True
Sheets("DATA COPY").Visible = True
With Sheets("DATA")
.Cells.ClearContents
End With
With Sheets("DATA COPY")
.Cells.ClearContents
End With
Sheets("DATA").Visible = xlVeryHidden
Sheets("DATA COPY").Visible = xlVeryHidden
Application.ScreenUpdating = True
End Sub
What could have gone wrong and how to debug it?
Regards