View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Earl Kiosterud Earl Kiosterud is offline
external usenet poster
 
Posts: 611
Default Macro Code required

Muddan,

Dim Coll As Integer
Dim Roww As Integer

Sub TimeReset()
Coll = 1
Roww = 1
End Sub

Sub TimeInsert()
If Roww = 0 Or Coll = 0 Then TimeReset
Cells(Coll, Roww) = Time()
If Roww = 1 Then
Roww = Roww + 1
Else
Roww = 1
Coll = Coll + 1
End If
End Sub

--
Regards from Virginia Beach,

Earl Kiosterud
www.smokeylake.com
-----------------------------------------------------------------------
"muddan madhu" wrote in message
...
Hi,

I have a macro to calculate the time ...
Col A - Start time
Col B - End Time

click Button created -e.g., if user click that buttton it gives the
system time as 00:06:53 in A1 (hh:mm:ss) and again
if user click that button it will gives the system 00:06:55 in
B1.... if user click that button again it moves to A2 and gives the
times...
similarly it moves down as and when user clicks..

The problem is user chooses different cells, so this lead wrong time
calculation so i need to specify the range as (B10:C100). so that the
time will
calculate in right manner.

Thanks a lot