Excel 宏按钮设置
发布网友
发布时间:2022-04-24 00:53
我来回答
共1个回答
热心网友
时间:2023-10-16 12:17
答:我写了2段示例代码,你套用下。
Sub 带上标统计()
For Each Cell In Range("E8:F8")
Cell.Value = Application.Evaluate(Cell.Value)
Next Cell
End Sub
Sub 不带上标统计()
Dim Cell As Range
For Each Cell In Range("E8:F8")
With Cell
For i = 1 To Len(.Value)
If .Characters(Start:=i, Length:=1).Font.Superscript Then
.Value = Val(Left(.Value, i - 1))
End If
Next
End With
Next Cell
End Sub