+ Reply to Thread
Results 1 to 10 of 10

Date/time groupe

  1. #1
    Johan H. Olsen
    Guest

    Date/time groupe

    Hi! I am trying to make a communicationlogg with a field that is
    supposed to be auto updated with date and time in the same cell. The
    time is supposed to be auto updated from the PC clock and the whole
    cell should be filled out just with hitting the return button.
    Is this possible?
    (Sorry for bad English.)



    Johan

  2. #2
    Tom Ogilvy
    Guest

    Re: Date/time groupe

    =now()

    in the cell, then hit F9 to update. It will actually update each time the
    sheet is calculated.

    --
    Regards,
    Tom Ogilvy

    "Johan H. Olsen" <[email protected]> wrote in message
    news:[email protected]...
    > Hi! I am trying to make a communicationlogg with a field that is
    > supposed to be auto updated with date and time in the same cell. The
    > time is supposed to be auto updated from the PC clock and the whole
    > cell should be filled out just with hitting the return button.
    > Is this possible?
    > (Sorry for bad English.)
    >
    >
    >
    > Johan




  3. #3
    Johan H. Olsen
    Guest

    Re: Date/time groupe

    On Sun, 15 May 2005 13:23:26 -0400, "Tom Ogilvy" <[email protected]>
    wrote:

    >=now()
    >
    >in the cell, then hit F9 to update. It will actually update each time the
    >sheet is calculated.


    Yes i see. but this only updates the one cell i am in. This is
    supposed to be a row of cells and each time we use a new line, we need
    to type inn the date and the time. This we would like to have more
    "auto".
    Sorry if i didn't explain myself good enough, its not so easy to make
    one selves understood in English.

    :-)

  4. #4
    Johan H. Olsen
    Guest

    Re: Date/time groupe

    On Sun, 15 May 2005 19:36:17 +0200, Johan H. Olsen <[email protected]>
    wrote:

    >On Sun, 15 May 2005 13:23:26 -0400, "Tom Ogilvy" <[email protected]>
    >wrote:
    >
    >>=now()
    >>
    >>in the cell, then hit F9 to update. It will actually update each time the
    >>sheet is calculated.

    >
    >Yes i see. but this only updates the one cell i am in. This is
    >supposed to be a row of cells and each time we use a new line, we need
    >to type inn the date and the time. This we would like to have more
    >"auto".
    >Sorry if i didn't explain myself good enough, its not so easy to make
    >one selves understood in English.
    >
    >:-)


    And the date/time in the cells that already has values should NOT be
    updated. Then all the cells get the same time/date..



  5. #5
    Tom Ogilvy
    Guest

    Re: Date/time groupe

    Right click on the sheet tab and select view code.

    in the left dropdown at the top of the resulting module select

    workbook

    and in the right dropdown select Change (not selectionchange)

    Private Sub Worksheet_Change(ByVal Target As Excel.Range)

    End Sub

    should appear.

    I don't know your exact situation, but let us say we want to put a date time
    value in column A whenever an entry is made in column B

    Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    if target.count > 1 then exit sub
    if target.column = 2 then
    With target.offset(0,-1)
    if not isempty(.value) then
    .Value = now
    .Numberformat = "dd/mm/yyyy hh:mm"
    .entireColumn.Autofit
    end if
    end with
    End if
    End Sub

    for general information on events, see Chip Pearson's page on events
    http://www.cpearson.com/excel/events.htm


    --
    Regards,
    Tom Ogilvy




    End Sub
    "Johan H. Olsen" <[email protected]> wrote in message
    news:[email protected]...
    > On Sun, 15 May 2005 19:36:17 +0200, Johan H. Olsen <[email protected]>
    > wrote:
    >
    > >On Sun, 15 May 2005 13:23:26 -0400, "Tom Ogilvy" <[email protected]>
    > >wrote:
    > >
    > >>=now()
    > >>
    > >>in the cell, then hit F9 to update. It will actually update each time

    the
    > >>sheet is calculated.

    > >
    > >Yes i see. but this only updates the one cell i am in. This is
    > >supposed to be a row of cells and each time we use a new line, we need
    > >to type inn the date and the time. This we would like to have more
    > >"auto".
    > >Sorry if i didn't explain myself good enough, its not so easy to make
    > >one selves understood in English.
    > >
    > >:-)

    >
    > And the date/time in the cells that already has values should NOT be
    > updated. Then all the cells get the same time/date..
    >
    >




  6. #6
    Tom Ogilvy
    Guest

    Re: Date/time groupe

    Made an error. Revision is:

    Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    If Target.Count > 1 Then Exit Sub
    If Target.Column = 2 Then
    With Target.Offset(0, -1)
    If Not IsEmpty(Target.Value) Then
    .Value = Now
    .NumberFormat = "dd/mm/yyyy hh:mm"
    .EntireColumn.AutoFit
    End If
    End With
    End If
    End Sub


    --
    Regards,
    Tom Ogilvy


    "Tom Ogilvy" <[email protected]> wrote in message
    news:[email protected]...
    > Right click on the sheet tab and select view code.
    >
    > in the left dropdown at the top of the resulting module select
    >
    > workbook
    >
    > and in the right dropdown select Change (not selectionchange)
    >
    > Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    >
    > End Sub
    >
    > should appear.
    >
    > I don't know your exact situation, but let us say we want to put a date

    time
    > value in column A whenever an entry is made in column B
    >
    > Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    > if target.count > 1 then exit sub
    > if target.column = 2 then
    > With target.offset(0,-1)
    > if not isempty(.value) then
    > .Value = now
    > .Numberformat = "dd/mm/yyyy hh:mm"
    > .entireColumn.Autofit
    > end if
    > end with
    > End if
    > End Sub
    >
    > for general information on events, see Chip Pearson's page on events
    > http://www.cpearson.com/excel/events.htm
    >
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    >
    >
    > End Sub
    > "Johan H. Olsen" <[email protected]> wrote in message
    > news:[email protected]...
    > > On Sun, 15 May 2005 19:36:17 +0200, Johan H. Olsen <[email protected]>
    > > wrote:
    > >
    > > >On Sun, 15 May 2005 13:23:26 -0400, "Tom Ogilvy" <[email protected]>
    > > >wrote:
    > > >
    > > >>=now()
    > > >>
    > > >>in the cell, then hit F9 to update. It will actually update each time

    > the
    > > >>sheet is calculated.
    > > >
    > > >Yes i see. but this only updates the one cell i am in. This is
    > > >supposed to be a row of cells and each time we use a new line, we need
    > > >to type inn the date and the time. This we would like to have more
    > > >"auto".
    > > >Sorry if i didn't explain myself good enough, its not so easy to make
    > > >one selves understood in English.
    > > >
    > > >:-)

    > >
    > > And the date/time in the cells that already has values should NOT be
    > > updated. Then all the cells get the same time/date..
    > >
    > >

    >
    >




  7. #7
    Johan H. Olsen
    Guest

    Re: Date/time groupe

    On Sun, 15 May 2005 13:58:46 -0400, "Tom Ogilvy" <[email protected]>
    wrote:

    >Made an error. Revision is:
    >
    >Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    >If Target.Count > 1 Then Exit Sub
    >If Target.Column = 2 Then
    > With Target.Offset(0, -1)
    > If Not IsEmpty(Target.Value) Then
    > .Value = Now
    > .NumberFormat = "dd/mm/yyyy hh:mm"
    > .EntireColumn.AutoFit
    > End If
    > End With
    >End If
    >End Sub


    So far thnx. It putted in the 1.0.00 00:00 in the cell..
    but i would like to have it to put in today's date and time taken from
    computers clock..and its important that it does NOT change the
    time/clock in any other cell than the one i at the moment is standing
    in,,puhhh this is more complicated than i belived..:-)


  8. #8
    Tom Ogilvy
    Guest

    Re: Date/time groupe

    It sounds like you didn't alter the code properly.

    From the immediate window:

    ? Now
    5/15/05 4:17:41 PM

    shows that now puts in what you ask for. (it certainly doesn't put in a
    zero - which i suspect is what you are showing)

    Perhaps post your version of the code and say what column will contain the
    date/time and what column triggers the code.

    --
    Regards,
    Tom Ogilvy

    "Johan H. Olsen" <[email protected]> wrote in message
    news:[email protected]...
    > On Sun, 15 May 2005 13:58:46 -0400, "Tom Ogilvy" <[email protected]>
    > wrote:
    >
    > >Made an error. Revision is:
    > >
    > >Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    > >If Target.Count > 1 Then Exit Sub
    > >If Target.Column = 2 Then
    > > With Target.Offset(0, -1)
    > > If Not IsEmpty(Target.Value) Then
    > > .Value = Now
    > > .NumberFormat = "dd/mm/yyyy hh:mm"
    > > .EntireColumn.AutoFit
    > > End If
    > > End With
    > >End If
    > >End Sub

    >
    > So far thnx. It putted in the 1.0.00 00:00 in the cell..
    > but i would like to have it to put in today's date and time taken from
    > computers clock..and its important that it does NOT change the
    > time/clock in any other cell than the one i at the moment is standing
    > in,,puhhh this is more complicated than i belived..:-)
    >




  9. #9
    Johan H. Olsen
    Guest

    Re: Date/time groupe

    On Sun, 15 May 2005 16:20:07 -0400, "Tom Ogilvy" <[email protected]>
    wrote:

    >It sounds like you didn't alter the code properly.
    >
    >From the immediate window:
    >
    >? Now
    >5/15/05 4:17:41 PM
    >
    >shows that now puts in what you ask for. (it certainly doesn't put in a
    >zero - which i suspect is what you are showing)
    >
    >Perhaps post your version of the code and say what column will contain the
    >date/time and what column triggers the code.


    Would like more to post/send the whole sheet to you as you look like
    you have lots of knowledge in this. Myself i am complete newbie and
    doesn't really know what to do..

    :-)

    Johan

  10. #10
    Tom Ogilvy
    Guest

    Re: Date/time groupe

    [email protected]

    --
    Regards,
    Tom Ogilvy

    "Johan H. Olsen" <[email protected]> wrote in message
    news:[email protected]...
    > On Sun, 15 May 2005 16:20:07 -0400, "Tom Ogilvy" <[email protected]>
    > wrote:
    >
    > >It sounds like you didn't alter the code properly.
    > >
    > >From the immediate window:
    > >
    > >? Now
    > >5/15/05 4:17:41 PM
    > >
    > >shows that now puts in what you ask for. (it certainly doesn't put in a
    > >zero - which i suspect is what you are showing)
    > >
    > >Perhaps post your version of the code and say what column will contain

    the
    > >date/time and what column triggers the code.

    >
    > Would like more to post/send the whole sheet to you as you look like
    > you have lots of knowledge in this. Myself i am complete newbie and
    > doesn't really know what to do..
    >
    > :-)
    >
    > Johan




+ 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