I want my macro to update the entire workbooks font, size and verticalaligment but all I can find are options to do it sheet by sheet. It's not too much hassle, but I was wondering whether you can't set these globally and update the entire workbook with 1 command.
Sub SetFormat()
With Sheets(1)
.Cells.Font.Name = "Segoe UI"
.Cells.Font.Size = 10
.Cells.VerticalAlignment = xlCenter
End With
End Sub
If that suits you, you can work on Styles
. Changing the default style of the workbook is very quick, but may have side effects. Try it.
With ActiveWorkbook.Styles("Normal").Font
.Name = "Aharoni"
.Size = 11
End With
This code should loop through every sheet in your workbook and change the properties.
Sub SetFormat()
Dim ws as Worksheet
For Each ws in Worksheets
With ws
.Cells.Font.Name = "Segoe UI"
.Cells.Font.Size = 10
.Cells.VerticalAlignment = xlCenter
End With
Next ws
End Sub
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With