Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用 VBA 将所有公式从一张表复制到另一张表。除了公式,我不想复制任何其他内容。有什么好方法可以做到这一点?
举例说明,如果源表包含:
formula value value blank formula value blank blank formula
目标表包含:
1 2 3 4 5 6 7 8 9
我希望目标表获取值:
formula 2 3 4 formula 6 7 8 formula
怎么样:
Sub dural() Dim r As Range, ady As String For Each r In Sheets("Sheet1").Cells.SpecialCells(xlCellTypeFormulas) ady = r.Address r.Copy Sheets("Sheet2").Range(ady) Next End Sub