+ Reply to Thread
Results 1 to 7 of 7

Thread: Auto date A1 when typing in A2

  1. #1
    Registered User
    Join Date
    08-16-2010
    Location
    Maidstone
    MS-Off Ver
    Excel 2007
    Posts
    7

    Unhappy Auto date A1 when typing in A2

    I would like to automatically put the date in cell A1 when I type in A2. But I don't want to use =now() becuase it auto updates. You can get the date by pressing crtl and semicolon without updating itself but I can't figue out how to put this in a formula.

    =IF(A2<>"",NOW(),"") but instead I want to use crtl + ;

    Thanks.
    Last edited by seanjacob; 08-16-2010 at 09:31 AM.

  2. #2
    Forum Guru sweep's Avatar
    Join Date
    04-03-2007
    Location
    Location: Location:
    MS-Off Ver
    3.0
    Posts
    2,472

    Re: Auto date A1 when typing in A2

    Hi,

    Place this code in the worksheet module
    Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, ActiveSheet.Range("A2")) Is Nothing Then Range("A1").Value = Now
    End Sub
    To do this,

    right click the tab of the appropriate sheet, select view code

    paste the code into the VBA editor that pops up

    close the vba editor.
    Please disregard anything in the above post. It may well have been edited without my consent, as has been the case with several posts and threads recently.

  3. #3
    Registered User
    Join Date
    08-16-2010
    Location
    Maidstone
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Auto date A1 when typing in A2

    Thanks for the reply!

    Sorry I didn't explain myself well. I would like this to run down the whole column so if typed into cell b6, a6 would show the date.

    Also using now() makes the date auto update which I would like it not to do.

  4. #4
    Forum Guru sweep's Avatar
    Join Date
    04-03-2007
    Location
    Location: Location:
    MS-Off Ver
    3.0
    Posts
    2,472

    Re: Auto date A1 when typing in A2

    Now modified to timestamp column A next to an entry in column B.

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Count > 1 Then Exit Sub
    If Not Intersect(Target, ActiveSheet.Range("B:B")) Is Nothing Then Target.Offset(0, -1).Value = Now
    End Sub
    Does this work for you?
    Last edited by sweep; 08-16-2010 at 08:40 AM. Reason: to trap .count > 1
    Please disregard anything in the above post. It may well have been edited without my consent, as has been the case with several posts and threads recently.

  5. #5
    Registered User
    Join Date
    08-16-2010
    Location
    Maidstone
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Auto date A1 when typing in A2

    Yes that worked great thankyou. Do you recon their is not a simple formula way of doing this? The only problem is that now() updates itself if only i could swap now() with crtl+; .

  6. #6
    Registered User
    Join Date
    08-16-2010
    Location
    Maidstone
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Auto date A1 when typing in A2

    How do you solve a thread?

  7. #7
    Forum Guru sweep's Avatar
    Join Date
    04-03-2007
    Location
    Location: Location:
    MS-Off Ver
    3.0
    Posts
    2,472

    Re: Auto date A1 when typing in A2

    I don't know of any way to do what you want without code, sorry!

    To mark your thread solved do the following: - Go to the first post - Click edit - Click Advance - Just below the word "Title:" you will see a dropdown with the word No prefix. - Change to Solve - Click Save
    Please disregard anything in the above post. It may well have been edited without my consent, as has been the case with several posts and threads recently.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.2.0