#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 747
Default Macro Code required

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
help required in completing the code deepika :excel help[_2_] Excel Discussion (Misc queries) 0 February 26th 08 09:15 AM
Code required for VLookup returning #NA Marie Bayes Excel Discussion (Misc queries) 7 January 10th 07 04:01 PM
Macro required PCOR Excel Worksheet Functions 3 December 11th 05 07:36 PM
Macro Help required Paul Sheppard Excel Discussion (Misc queries) 2 December 8th 05 10:30 PM
vba macro required ? Peter O'Leary Links and Linking in Excel 1 April 14th 05 11:49 PM


All times are GMT +1. The time now is 09:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"