How to set column formatting using a macro? I need to set font size to 11 and text position to center. To make this formatting work automatically in an Excel sheet.
CodePudding user response:
Example for column B (column index 2)
Sub doColumns()
Columns(2).Font.Size = 11
Columns(2).HorizontalAlignment = xlCenter
End Sub