Hello,
I am trying to copy at the end of a column the new values from a column in a different sheet. Simply put i am trying to synch the columns in both sheets.
I found some code on the net but it only worked up to the point i was updating every single cell directly.
What i want is the code to work when you paste an entire column over the column in sheet 2
I have done some changes to this code but it's not working when i paste the entire column with some values instead of the blanks or extra values or a bigger range including this column.
note: i have tried some variations of Intersect but only worked on individual cells not the full column or the full column or a bigger range including this column.
EDIT:
attached is an example. i want to synch by using the Fruit code.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim sourceSheet As Worksheet, targetSheet As Worksheet
Dim syncRange As String
Dim isInRange
'Set the source and target sheets here
Set sourceSheet = Sheet9
Set targetSheet = Sheet3
'This will be the column that needs to be synced
syncRange = "C13:C500"
'Check if the modified cell lies within the range to be synced
Set isInRange = Application.Intersect(Target, Range(syncRange))
If isInRange Is Nothing Then
'Do nothing if the cell falls outside the range
Else
'Else sync the cell contents
Sheet3.Range("d4").End(xlDown).Offset(1, 0) = sourceSheet.Range(Target.Address)
End If
End Sub
Bookmarks