Forum Discussion
ajiespedas
Jun 03, 2023Copper Contributor
when row value changes, copy the row value to a new worksheet but also retain each change
good day gentlemen, i needed help, ive been searching to the internet regarding using vba. im a excel noob trying to use vba to copy certain data to another worksheet.i have been trying all the ...
OliverScheurich
Jun 03, 2023Gold Contributor
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngBereich As Range
Dim i, j As Long
Set rngBereich = Range("H6")
If Target.Cells.Count > 1 Then GoTo done
If Not Application.Intersect(Target, rngBereich) Is Nothing Then
If Target.Value <> 0 Then
j = Sheets("HOUR").Range("E" & Rows.Count).End(xlUp).Row
For i = 3 To 14
Sheets("HOUR").Cells(j + 1, i).Value = Cells(13, i).Value
Next i
Else
End If
End If
done:
Application.EnableEvents = True
Exit Sub
End Sub
You can try the Worksheet_Change event. In the attached file you can update data in range C13:N13. If you then change the date in cell H6 the data is copied to sheet "HOUR".
ajiespedas
Jun 03, 2023Copper Contributor
OliverScheurichthanks for the reply sir, let me have a try and will update ya with the result.
by the way, thanks for replying, means alot