Hi FJ
If you want to run the macro when you open your workbook (file).
1- The code goes on the Thisworkbook module Procedure as shown in the picture below
2- Specify the sheet/range or sheets/ranges you want to delete contents
Private Sub Workbook_Open()
With Sheets("Sheet1")
.Range("A1").ClearContents ''' Deletes contents but not cell format
.Range("A1").Value = "" ''' Deletes contents but not cell format
.Range("A1").Clear ''' Deletes all
End With
End Sub
'''''******************************************************************************************
If you have the workbook (file) opened and you want to run the macro once you activate the specific sheet then
The code below goes to the Worksheet event panel
Choose the command you prefer.
Private Sub Worksheet_Activate()
Range("A1").ClearContents ''' Deletes contents but not cell format
Range("A1").Value = "" ''' Deletes contents but not cell format
Range("A1").Clear ''' Deletes all
End Sub
'''********************************************************************
If you need more help, please,
Be more specific and give us more details of your scenario and goals.