Currently I have an Excel file which enters a time stamp depending on if a value is entered in Column A. So it looks like this
[TABLE="width: 500"]
<tbody>[TR]
[TD]Column A[/TD]
[TD]Column B[/TD]
[TD]Column C[/TD]
[/TR]
[TR]
[TD]Data<where value="" is="" entered<<="" td=""></where>[/TD]
[TD]Blank<blank for="" now=""></blank>[/TD]
[TD]A Date Stamp auto fills when
something is entered in Column A[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
For this to work I have the following code in Sheet 1:
I also have a Drop Down Box which is populated with values in Sheet 2.
Question 1: The User will specify a value in a dropdown box prior to entering but how can I ensure this value, auto goes into a separate cell (on the same row) - i.e. H1
Question 2: If a user does try to edit the file without selecting a value in dropdown box, I want it to be impossible to edit.
Question 3: How could I amend the code to include more than one column? i.e. if Column A is changed it puts date stamp, but I want it so if Column B is also changed it updates date stamp.
Thank you for any help in advance
[TABLE="width: 500"]
<tbody>[TR]
[TD]Column A[/TD]
[TD]Column B[/TD]
[TD]Column C[/TD]
[/TR]
[TR]
[TD]Data<where value="" is="" entered<<="" td=""></where>[/TD]
[TD]Blank<blank for="" now=""></blank>[/TD]
[TD]A Date Stamp auto fills when
something is entered in Column A[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
For this to work I have the following code in Sheet 1:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Specifies Column A
If Target.Column <> 1 Then Exit Sub
If Target.Cells.Count > 1 Then Exit Sub
'Specifies the Target as Column C. If Above code specified 5 (i.e. Column E), 2 below would put data in Column G
With Target.Offset(0, 2)
.Value = Now
.NumberFormat = "MM/DD/YYYY hh:mm AM/PM"
End With
End Sub
I also have a Drop Down Box which is populated with values in Sheet 2.
Question 1: The User will specify a value in a dropdown box prior to entering but how can I ensure this value, auto goes into a separate cell (on the same row) - i.e. H1
Question 2: If a user does try to edit the file without selecting a value in dropdown box, I want it to be impossible to edit.
Question 3: How could I amend the code to include more than one column? i.e. if Column A is changed it puts date stamp, but I want it so if Column B is also changed it updates date stamp.
Thank you for any help in advance
Last edited: