Forum Discussion
copy data to different worksheet
- Jul 22, 2021
Right-click the sheet tab of Sheet1.
Select 'View Code' from the context menu.
Copy the following code into the worksheet module:
Private Sub Worksheet_Calculate() Static OldVal As Variant If Range("C3").Value <> OldVal Then ThisWorkbook.Save OldVal = Range("C3").Value End If End Sub
sir,
i have done some changes.Which may work .I have copy the cell from copy.xls and paste it as link in paste.xlsm in sheet 2
and make reference in C3 cell in sheet 1 from F2 of sheet 2
just help required from you to make it autosave.
whenever C3 value will be changed it will autosave the sheet.
Right-click the sheet tab of Sheet1.
Select 'View Code' from the context menu.
Copy the following code into the worksheet module:
Private Sub Worksheet_Calculate()
Static OldVal As Variant
If Range("C3").Value <> OldVal Then
ThisWorkbook.Save
OldVal = Range("C3").Value
End If
End Sub
- samnptiJul 27, 2021Brass Contributor
I did in that way.But its giving error.
Private Sub Worksheet_Calculate()
Static OldVal As Variant
If Range("C3:C15").Value <> OldVal Then
ThisWorkbook.Save
OldVal = Range("C3:C15").Value
End If
End SubOr can u make any changes in sheet 1 will save?
- HansVogelaarJul 27, 2021MVP
You can simply change "C3" to "C15" in the code.
- samnptiJul 27, 2021Brass ContributorSIR
can you make change of range to C3 to C15? - samnptiJul 23, 2021Brass ContributorThanks its working