Apply format to selection
Brief description:
Applies common formatting settings to selected range
Full description:
Applies the common cell formatting settings to the selected range. These are the same settings found in the ‘alignment’ group in the ‘home’ tab.
To use: Delete or comment out any settings you don’t want to use. Modify format settings to suit. Select the range that the formatting is to be applied to.
Code:
Option Explicit 'For selected cells, set indentation to 0 Sub ApplyFormatting() Dim SelRng As Range Set SelRng = Selection With SelRng ' .HorizontalAlignment = xlLeft ' .HorizontalAlignment = xlCenter ' .HorizontalAlignment = xlRight ' .VerticalAlignment = xlTop ' .VerticalAlignment = xlCenter ' .VerticalAlignment = xlBottom ' .WrapText = False ' .Orientation = 0 ' .AddIndent = False ' .IndentLevel = 0 End With End Sub