[英]How to copy cell value ONLY to another cell in other worksheet
為了繞過excel中的循環引用,每次重新計算值時,我都想將計算出的值(僅值)復制並粘貼到另一個工作表中的另一個單元格中。 我想只有通過 VBA 才有可能。 不幸的是,我無法想出任何對我有用的代碼。 我會很高興有想法。 謝謝你。
[編輯]我試過的代碼:
Sheets("Sheet1").Range("A1").MergeArea.Copy
Sheets("Sheet2").Range("B2").PasteSpecial xlPasteValues
將此代碼粘貼到“Sheet1”的代碼窗口中
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Sheets("Sheet2").Range("B2").Value = Target.Value
End If
End Sub
此代碼將在“Sheet1”上發生更改時運行,並且只會將值(而不是公式)放入“Sheet2”上的單元格“B2”中
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.