+ Reply to Thread
Results 1 to 3 of 3

Time

Hybrid View

  1. #1
    Kajo
    Guest

    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. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    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

  3. #3
    Kajo
    Guest

    Re: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1