Hi All,
I am having some trouble with achieving my desired outcome in Excel.
I am setting up a spreadsheet that gives the ability of the user to enter timmings for specific activities. I am using a timestamp whereby the user can click on column 2 & column 6
which is the 'Start' & 'End' time. In column 7 would give the total time it took to complete that activity/phone call (= column 6 - column 2).
Here is my initial code which appears to work well and gives the time down to the second.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)</SPAN></SPAN>
If Target.Columns.Count > 1 Then Exit Sub</SPAN></SPAN>
If Target.Column <> 6 And Target.Column <> 2 Then Exit Sub</SPAN></SPAN>
Target.Value = Now - Date</SPAN></SPAN>
Target.NumberFormat = "h:m:ss"</SPAN></SPAN>
End Sub
However I need to ensure that when users enter data into both these columns the cells automatically lock to ensure they dont overwrite the data. Furthermore if the user clicks on the entire Column by selecting 'column B' for instances it automatically populates the data in every single cell from B1-B1000000 ETC.
1. How can I look the cells so it does not overwrite previous data
2. Ensure that if users click on the entire column it wont pre populate thounds of cells of data.
Any help would be appreciated.
Cheers
</SPAN></SPAN>
I am having some trouble with achieving my desired outcome in Excel.
I am setting up a spreadsheet that gives the ability of the user to enter timmings for specific activities. I am using a timestamp whereby the user can click on column 2 & column 6
which is the 'Start' & 'End' time. In column 7 would give the total time it took to complete that activity/phone call (= column 6 - column 2).
Here is my initial code which appears to work well and gives the time down to the second.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)</SPAN></SPAN>
If Target.Columns.Count > 1 Then Exit Sub</SPAN></SPAN>
If Target.Column <> 6 And Target.Column <> 2 Then Exit Sub</SPAN></SPAN>
Target.Value = Now - Date</SPAN></SPAN>
Target.NumberFormat = "h:m:ss"</SPAN></SPAN>
End Sub
However I need to ensure that when users enter data into both these columns the cells automatically lock to ensure they dont overwrite the data. Furthermore if the user clicks on the entire Column by selecting 'column B' for instances it automatically populates the data in every single cell from B1-B1000000 ETC.
1. How can I look the cells so it does not overwrite previous data
2. Ensure that if users click on the entire column it wont pre populate thounds of cells of data.
Any help would be appreciated.
Cheers
</SPAN></SPAN>