+ Reply to Thread
Results 1 to 15 of 15

Automatic date entry in cell?

Hybrid View

  1. #1
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    The TODAY() & NOW() Functions are volatile & will change whenever the workbook calculates.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  2. #2
    Registered User
    Join Date
    07-09-2008
    Location
    UK
    Posts
    20
    yeah, of course, i didnt think about that. I had just considered that it would update as it was entered... not too sure how to get the time to almost 'imprint' itself on the worksheet. I will have a think...!

  3. #3
    Registered User
    Join Date
    07-07-2008
    Location
    Chicago
    Posts
    17

    Right.

    ...and I just found out the Microsoft help says as much - should have checked that first. Sure enough, any time I make changes to any part of the sheet, the date/time refreshes.

    Anyone have other ideas for how to "stamp" the d/t at the point of data entry without having it refresh like that?

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You will need VBA. Use the WorkSheet_Change event

    Option Explicit
    
    Private Sub Worksheet_Change(ByVal Target As Range)
        If Target.Count > 1 Or Target.Column <> 2 Then Exit Sub
        Target.Offset(0, -1).Value = Date
        Target.Offset(0, 1).Value = Environ("username")
        Traget.Offset(0, 2).Select
    End Sub
    Right Click on the sheet tab
    Choose "view code"
    In the VB Editor set the left hand drop down to WorkSheet
    In the VB Editor set the right hand drop down to Change
    Paste in the code

  5. #5
    Registered User
    Join Date
    07-07-2008
    Location
    Chicago
    Posts
    17

    Question before I test this...

    ...I already have a bit of code titled "Worksheet_Change" in each sheet. Can I just rename either of these code snippets to something else?

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You will have the code procedure in each sheet, are you actually using it with code in there? If you are then you will need to amend the code.

    Note: there's a typo in the original code

    Traget.Offset(0, 2).Select
    should be
    Target.Offset(0, 2).Select

  7. #7
    Registered User
    Join Date
    07-07-2008
    Location
    Chicago
    Posts
    17

    Not quite

    First of all, I really appreciate all of your help with this. Unfortunately, this bit of code didn't have any effect.

    Correct me if I'm wrong, but it looks like this code doesn't deal specifically with the range of cells I'm entering the names/contacts' info into, but of course with my limited experience I'm not sure. I might be able to figure it out if you explained what the different lines in the code are doing.

    So, just to be a bit more explicit, the "call log" this date entry would be a part of is in the lower third of the sheet, in cells A47:K63 (the top 2/3, rows 3 to 46, is basically a list of tasks that we're making sure clients are performing, with a status indicator and notes next to each). The columns in the range are labeled as follows (every other column is a spacer column, and there are some merged cells, hence the skipping):

    A: Date.
    C: Person Contacted. A drop-down menu appears when the cells in this column are clicked, with the contact to be chosen from a list.
    G: Caller. Selected from a list that appears in a drop down menu when clicked.
    I: Notes. User can type comments here.

    So, I'd like to have the date appear in its respective row when C47:63 or G47:63 are updated. It doesn't necessarily have to be both together, but I think in most cases users, will enter both a Person Contacted and a Caller.

    Sorry to be long-winded. Thanks again for all of your assistance.

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Can you attach a zipped workbook with your layout, with any confidential data deleted? I will then be able to see better what you need.

+ 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