dannyok90
Board Regular
- Joined
- Aug 30, 2016
- Messages
- 115
Hi All,
I'm trying to manipulate the following script.
When I paste new data over a range on sheet 1 I would like the old data range copied and pasted into sheet 2.. id like this as a cycle.. every time I paste new data over the data in sheet 1 the old data overwrites the older data in sheet2 - so basically I have the current and previous weeks data In the workbook at all times
any guidance would be great!
I'm trying to manipulate the following script.
When I paste new data over a range on sheet 1 I would like the old data range copied and pasted into sheet 2.. id like this as a cycle.. every time I paste new data over the data in sheet 1 the old data overwrites the older data in sheet2 - so basically I have the current and previous weeks data In the workbook at all times
any guidance would be great!
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim WorkRng As Range
Dim Rng As Range
Dim xOffsetColumn As Integer
Set WorkRng = Intersect(Application.ActiveSheet.Range("A:A"), Target)
xOffsetColumn = 3
If Not WorkRng Is Nothing Then
Application.EnableEvents = False
For Each Rng In WorkRng
If Not VBA.IsEmpty(Rng.Value) Then
'code here maybe?
Else
'code here maybe?
End If
Next
Application.EnableEvents = True
End If
End Sub