选择要转换的单元格并运行此短宏:
Sub WaitaBit()
Dim r As Range, v As Variant
For Each r In Selection
v = r.Value
If IsNumeric(v) And v <> "" Then
s = Application.WorksheetFunction.Dec2Bin(v, 10)
Do While Left(s, 1) = "0"
s = Mid(s, 2)
Loop
r.Value = "'" & s
End If
Next r
End Sub
所以:
将成为:
这将处理大多数“小”整数。