This works:
Hi, I have made a bit of code to ClearContents of a range of cells. At the moment in clears every sheet expect one of my choosing. But I need to choose 5 sheets instead of one.
Can any one help.
Thanks.
Option Explicit
Sub ClearA1toJ92()
Dim ws As Worksheet
Dim TheName As String
TheName = "Sheet2"
For Each ws In ActiveWorkbook.Worksheets
If Not ws.Name = TheName Then
ws.Range("A1:J9").ClearContents
End If
Next ws
End Sub