PMRetired2012
Board Regular
- Joined
- Aug 6, 2019
- Messages
- 123
I have a file that i was wondering if there was a way to write this code differently or easier. The file has 7 worksheets and a button page. i want to clear all worksheet and end up on cell A2 of the button page. Here is the code:
Dim sht As Worksheet
For Each sht In ActiveWorkbook.Sheets
If sht.Name <> "MASTER SHEET" And sht.Name <> "BUTTON PAGE" And sht.Name <> "ADDRESS MASTER SHEET" Then 'PRE K-K 1ST-2ND 3RD-4TH 5TH-6TH BOYS 5TH-6TH GIRLS'
sht.Range("A2:P39").Value = ""
End If
Next sht
'Clear Master Sheet Cells
Sheets("MASTER SHEET").Select
Range("A2:S39").Select
Selection.ClearContents
Range("A2").Select
'Clear Address Master Sheet
Sheets("Address MASTER SHEET").Select
Range("A2:G75").Select
Selection.ClearContents
Range("A2").Select
Sheets("BUTTON PAGE").Select
Range("A2").Select
End Sub
Dim sht As Worksheet
For Each sht In ActiveWorkbook.Sheets
If sht.Name <> "MASTER SHEET" And sht.Name <> "BUTTON PAGE" And sht.Name <> "ADDRESS MASTER SHEET" Then 'PRE K-K 1ST-2ND 3RD-4TH 5TH-6TH BOYS 5TH-6TH GIRLS'
sht.Range("A2:P39").Value = ""
End If
Next sht
'Clear Master Sheet Cells
Sheets("MASTER SHEET").Select
Range("A2:S39").Select
Selection.ClearContents
Range("A2").Select
'Clear Address Master Sheet
Sheets("Address MASTER SHEET").Select
Range("A2:G75").Select
Selection.ClearContents
Range("A2").Select
Sheets("BUTTON PAGE").Select
Range("A2").Select
End Sub