I am trying to run this code on all worksheets that I have in one excel file but this is not working. It only merges cells on first sheet. Here is my code:
Sub MergeColumns()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
Select Case ws.Name
Case "Sheet1", "Sheet2", "Sheet3", "Sheet4"
ws.Range("H1:S1").Select
Case Else
Selection.Merge
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
End With
End Select
Next ws
End Sub
I would appreciate your time regarding the same.