下面的例程将 activecell 整数替换为数字之前的数字和 = 以及右侧两列的数字,但当数字为十进制时显示错误 1004。
我该如何解决?
Sub EnterEqual()
Dim CellContent As Variant
Dim cell As Variant
For Each cell In Selection
CellContent = cell.Value
cell.ClearContents
cell.Value = "=" & CellContent & "+" & "rc[2]"
Next cell
End Sub