I need to clear specific cells & unmerge 2 cells on every worksheet except Sheet1.
Below is the code I'm using, however, after updating all pages appropriately, it updates Sheet1 as well. Help! VBA newbie . . .
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> "Sheet1" Then
Range("G5").Select
Selection.ClearContents
Range("I8:J8").Select
Selection.ClearContents
Range("D14:E14").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Selection.UnMerge
Range("F4").Select
End If
Next ws
End Sub
Below is the code I'm using, however, after updating all pages appropriately, it updates Sheet1 as well. Help! VBA newbie . . .
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> "Sheet1" Then
Range("G5").Select
Selection.ClearContents
Range("I8:J8").Select
Selection.ClearContents
Range("D14:E14").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Selection.UnMerge
Range("F4").Select
End If
Next ws
End Sub