+ Reply to Thread
Results 1 to 4 of 4

date/time

  1. #1
    Jan
    Guest

    date/time

    I'm using Excel 2003.

    Is this possible?

    If end user enters data in A1, can I add a date/time function that will
    automatically be entered in cell B1, but not update when the date/time
    changes or when the file is closed/opened? Using Today() or Now(), the
    date/time in B1 updates when file is closed and then opened.

    TIA

  2. #2
    Forum Contributor
    Join Date
    06-10-2004
    Location
    India
    Posts
    1,066
    Enter this code in the module of the concerned sheet.

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = "$A$1" Then
    Range("B1") = Now()
    End If
    End Sub


    Will change the date only when you change or enter value in A1

    Mangesh

  3. #3
    Jan
    Guest

    Re: date/time

    It is just not cell A1 and b1; the concept needs to apply between column a
    and column b. How would you change the following code to apply between
    column a and b? Sorry, I know very little about VBA.

    "mangesh_yadav" wrote:

    >
    > Enter this code in the module of the concerned sheet.
    >
    > Private Sub Worksheet_Change(ByVal Target As Range)
    > If Target.Address = "$A$1" Then
    > Range("B1") = Now()
    > End If
    > End Sub
    >
    >
    > Will change the date only when you change or enter value in A1
    >
    > Mangesh
    >
    >
    > --
    > mangesh_yadav
    > ------------------------------------------------------------------------
    > mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
    > View this thread: http://www.excelforum.com/showthread...hreadid=379994
    >
    >


  4. #4
    Jan
    Guest

    Re: date/time

    Sorry, but I failed to mention the process correctly.

    If end user enters data in any cell in column A beginning at cell a2, then I
    would like the corresponding cell(same row) in column B to have a date/time
    stamp that would not change when the date/time changes or when the file is
    saved and reopened.

    Example: if user enters data in cell A2, then B2 would automatically
    display date/time stamp. If user enters data in cell A3, then B3 would have
    a date/time stamp...and so on..and so on.

    TIA.

    "Jan" wrote:

    > It is just not cell A1 and b1; the concept needs to apply between column a
    > and column b. How would you change the following code to apply between
    > column a and b? Sorry, I know very little about VBA.
    >
    > "mangesh_yadav" wrote:
    >
    > >
    > > Enter this code in the module of the concerned sheet.
    > >
    > > Private Sub Worksheet_Change(ByVal Target As Range)
    > > If Target.Address = "$A$1" Then
    > > Range("B1") = Now()
    > > End If
    > > End Sub
    > >
    > >
    > > Will change the date only when you change or enter value in A1
    > >
    > > Mangesh
    > >
    > >
    > > --
    > > mangesh_yadav
    > > ------------------------------------------------------------------------
    > > mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
    > > View this thread: http://www.excelforum.com/showthread...hreadid=379994
    > >
    > >


+ 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