先选中单元格范围,然后运行代码即可。
Sub CellFormat()
Dim rng As Range
For Each rng In Selection
Select Case rng.Value
Case Is < 0.000005
rng.NumberFormatLocal = "0.00000"
rng.Font.Bold = True
Case Is < 0.00005
rng.NumberFormatLocal = "0.00000"
Case Is < 0.0095
rng.NumberFormatLocal = "0.0000"
Case Is < 0.095
rng.NumberFormatLocal = "0.000"
Case Is < 100
rng.NumberFormatLocal = "0.00"
Case Is >= 100
rng.NumberFormatLocal = "0.00"
rng.Font.Bold = True
End Select
Next rng
End Sub