Answers:
这是执行此操作的代码段,假设您要修改当前选定的单元格:
Sub Macro1()
'
' Macro1 Macro
'
' Keyboard Shortcut: Ctrl+q
'
On Error Resume Next 'In case "Selection" is something that doesn't have a NumberFormat property
If Selection.NumberFormat = "0" Then Selection.NumberFormat = "0.00" Else: Selection.NumberFormat = "0"
End Sub
selection.font.color = vbblack