Change the selected cell format : Cell Number Format « Excel « VBA / Excel / Access / Word






Change the selected cell format

 
Sub FormatCell()
    Dim myVar As Range
    Set myVar = Selection
    With myVar
        .NumberFormat = "#,##0.00_);[Red](#,##0.00)"
        .Columns.AutoFit
    End With

End Sub

 








Related examples in the same category