I thought i knew Excel
New Member
- Joined
- Oct 1, 2015
- Messages
- 3
Hey any help would be highly appreciated
as a control feature i would like to know when a set of data was last updated. My data is as followers for the columns A,B & C
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Company X[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Header[/TD]
[TD]Value[/TD]
[TD]Date[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Name1[/TD]
[TD]x[/TD]
[TD]31/06/2015[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Name2[/TD]
[TD]y[/TD]
[TD]31/06/2015[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Name3[/TD]
[TD]z[/TD]
[TD]31/06/2015[/TD]
[/TR]
[TR]
[TD]...[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]26[/TD]
[TD]until row 26[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
i would like excel to automatically give a date stamp, when a value is updated. I only want this to work for the values from B4 to B26, and the Date stamps to be input respectively in C4 to C26. I have other data below row 26 that should not be affected by this.
i am working on the following code, but i can not get it to work for the full range of rows. i can only make it work for one row.
I hoped I could change
to
but with no luck, how do i specify the larger range, without it working on all rows?
all the best
Marc
as a control feature i would like to know when a set of data was last updated. My data is as followers for the columns A,B & C
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Company X[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Header[/TD]
[TD]Value[/TD]
[TD]Date[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Name1[/TD]
[TD]x[/TD]
[TD]31/06/2015[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Name2[/TD]
[TD]y[/TD]
[TD]31/06/2015[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Name3[/TD]
[TD]z[/TD]
[TD]31/06/2015[/TD]
[/TR]
[TR]
[TD]...[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]26[/TD]
[TD]until row 26[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
i would like excel to automatically give a date stamp, when a value is updated. I only want this to work for the values from B4 to B26, and the Date stamps to be input respectively in C4 to C26. I have other data below row 26 that should not be affected by this.
i am working on the following code, but i can not get it to work for the full range of rows. i can only make it work for one row.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Cell As Range
For Each Cell In Target
With Cell
If .Column = Range("B:B").Column And .Row = Range("4:4").Row Then
Cells(.Row, "C").Value = Int(Now)
End If
End With
Next Cell
End Sub
I hoped I could change
Code:
.Column = Range("B:B").Column And [B].Row = Range("4:4").Row[/B] Then
to
Code:
.Column = Range("B:B").Column And [B].Row = Range("4:26").Row[/B] Then
but with no luck, how do i specify the larger range, without it working on all rows?
all the best
Marc