Mega Code Archive

 
Categories / VisualBasic Script / Excel
 

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