粘贴公式不改变公式中引用单元格地址
公布结果:
Sub 粘贴公式()
ActiveCell.Formula = Application.InputBox("源单元格", , , , , , , 8).Formula
ActiveCell.HorizontalAlignment = xlCenter '横居中
ActiveCell.VerticalAlignment = xlCenter '竖居中
End Sub
-------------------------------------------------------------
Sub 粘贴多公式()
Dim rng()
rng = Application.InputBox("源单元格", , , , , , , 8).Formula
S = UBound(rng)
For I = 1 To S
ActiveCell.Offset(I - 1, 0).Formula = rng(I, 1)
Next
End Sub