Hi -
I wrote the following code to be able to hit a macro button to format columns "J:M" with the "comma" format on all worksheets, but it doesn't work. When I click the Macro button, it highlights the columns but then doesn't format them. It doesn't error out either... What is my code missing?
Here is the code:
Private Sub CommandButton5_Click()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
With ws
Columns("J:M").Select
Selection.Style = "Comma"
End With
Next ws
End Sub
Thanks!
I wrote the following code to be able to hit a macro button to format columns "J:M" with the "comma" format on all worksheets, but it doesn't work. When I click the Macro button, it highlights the columns but then doesn't format them. It doesn't error out either... What is my code missing?
Here is the code:
Private Sub CommandButton5_Click()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
With ws
Columns("J:M").Select
Selection.Style = "Comma"
End With
Next ws
End Sub
Thanks!