#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Time

I'm trying to make a worksheet that counts time. I've done the period time to
the left and the days on top. I want Excel to count 20minutes every time
someone fills in a text in the cells below the days. If he/she for example
fills in math it should count 20 minutes in another cell where the total time
will be found. If nothing is filled in the cell it shall remain empty.
Counting the time is no problem the problem beginns when I want excel to
react when someone writes in a cell. I've got excel 97.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Time


you will need a formula something like this
=IF(A1="","","0:20")

or you will need a worksheet event macro like this

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Column = 1 Then
If Target.Value < "" Then
Cells(Target.Row, 2) = "0:20"
End If
End If
Application.EnableEvents = True
End Sub


--
mudraker
------------------------------------------------------------------------
mudraker's Profile: http://www.excelforum.com/member.php...fo&userid=2473
View this thread: http://www.excelforum.com/showthread...hreadid=538380

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Time

Thank you!
Trouble is when I create a worksheet event macro like you suggest it wont
run. It says "You used End Function or End Property to end a Sub procedure.
Use End Sub for this type of procedure."
I don't get it?! I've used End sub as I should, so what's wrong here?
Kajo


"mudraker" skrev:


you will need a formula something like this
=IF(A1="","","0:20")

or you will need a worksheet event macro like this

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Column = 1 Then
If Target.Value < "" Then
Cells(Target.Row, 2) = "0:20"
End If
End If
Application.EnableEvents = True
End Sub


--
mudraker
------------------------------------------------------------------------
mudraker's Profile: http://www.excelforum.com/member.php...fo&userid=2473
View this thread: http://www.excelforum.com/showthread...hreadid=538380


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
Time calculations for Scheduled Time vs. Actual Time Worked The Caterer Excel Discussion (Misc queries) 1 November 29th 09 08:08 AM
straight time, time and a half, and double time Jeremy Excel Discussion (Misc queries) 3 September 23rd 08 09:03 PM
Calculate Ending time using Start Time and Elapsed Time Chief 711 Excel Worksheet Functions 5 May 13th 08 04:34 PM
Formula to find Stop Time from Start Time and Total Minutes Jonathan Bickett Excel Worksheet Functions 5 March 7th 07 05:22 PM
Calculating days & time left from start date/time to end date/time marie Excel Worksheet Functions 7 December 7th 05 02:36 PM


All times are GMT +1. The time now is 10:33 AM.

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

About Us

"It's about Microsoft Excel"