I have requirement, where I need to copy values(not formula) in a sheet cells part of a range to corresponding cells in another sheet and then from second sheet to corresponding cells in third sheet.
for copying data from first two second I am using below code,
Sub Test()
Dim rng As Range
Dim c As Range
Dim dest As Worksheet
Set rng = Range("C3:E3")
Set dest = ThisWorkbook.Worksheets("Sheet2")
For Each c In rng
c.Copy dest.Cells(c.Row, c.Column)
Next c
End Sub
Now, I would like to copy from sheet2
to sheet3
. I need this specifically from sheet2
, because my first sheet may have different value than sheet2.
Copy
, you can do thisdest.Cells(c.Row, c.Column).Value = c.Value
– Tim WilliamsCopy
used because the cells may have different data later and I need to keep them as separate – acr.Value = .Value
only changes the value when the macro runs. Your issue with changing references doesn't apply @acr – Chrismas007