Current time by clicking comm button in excel

Closed
geoganesh_80 Posts 1 Registration date Monday July 12, 2010 Status Member Last seen July 12, 2010 - Jul 12, 2010 at 05:05 AM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Aug 26, 2010 at 03:48 AM
Hello,


how to get the current time by clicking command button for any active cell

3 responses

venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Jul 12, 2010 at 05:58 AM
bring a "comman button" from the control toolbar and place it somewhere in the sheet.
right click the sheet tab and click view code. There you copy this code


Private Sub CommandButton1_Click()
ActiveCell = Now()
ActiveCell.NumberFormat = "hh:mm:ss"
End Sub
14
whr z cmmnd button in ctrl toolbar??i hv to wrk this thing in excel sheet & thr z no control toolbar thr.....
I wnt to display current time whn a cell of xcel sheet is clicked..
0