+ Reply to Thread
Results 1 to 10 of 10

When specific value entered in one column, fill date column automatically

  1. #1
    Registered User
    Join Date
    07-15-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2003
    Posts
    12

    When specific value entered in one column, fill date column automatically

    Hi all,

    I need some help

    When I enter the value "In Process" into column Q, I need column R to populate with the date. And similarly, when the value "Complete" is entered into column Q, I need column S to populate with the date.

    I basically am trying to keep track of how long things in my list are marked 'in process'.

    I found this for entering the date when ANY value is entered, but I am not familiar with VB enough to make it work how I want.

    Private Sub Worksheet_Change(ByVal Target As Range)

    If Target.Cells.Count > 1 Then Exit Sub

    If Not Intersect(Target, Range("Q2:Q1000")) Is Nothing Then

    With Target(1, 2)

    .Value = Date

    .EntireColumn.AutoFit

    End With

    End If

    End Sub


    Any advice is greatly appreciated!
    Emily

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: When specific value entered in one column, fill date column automatically

    You were almost there.

    Please Login or Register  to view this content.
    Martin

  3. #3
    Registered User
    Join Date
    07-15-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: When specific value entered in one column, fill date column automatically

    Thank you so much -

    This will work, but how I currently have the spreadsheet set up is for column Q to have data validation set with a drop down to select either 'In Process' or 'Complete'. I should have mentioned this earlier. I realize selecting the value does not put the date in, It seems like I have to type it into the cell?

    This will work but I'm curious if it can work with the data validation on?

    Also, I notice, if I drag values down (without hitting enter on the specific cell) the date doesn't get filled in.

    Thank you again so much for your help. You have already save a ton of time.

  4. #4
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: When specific value entered in one column, fill date column automatically

    Hmmmm...

    It seems to work for me even with validation. Are you sure that the strings are exactly the same?

    Please see attachment.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    07-15-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: When specific value entered in one column, fill date column automatically

    How strange - I repoened my file and it's working now. Thanks so much.

    I'm out of luck when dragging down, right?

    Also, if I add another case for if I change column Q back to blank, would something like this work?

    Case Is = ""
    Target.Offest(0, 1).Clear
    Target.Offset(0, 2).Clear

    (although obviously it doesn't because I wouldn't be asking if it did)

    Thanks again : )

  6. #6
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: When specific value entered in one column, fill date column automatically

    This should do it.

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-15-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: When specific value entered in one column, fill date column automatically

    is that the same code as before?

  8. #8
    Registered User
    Join Date
    07-15-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: When specific value entered in one column, fill date column automatically

    Sorry - I see that it's different. But it doesn't seem to clear the dates if I remove the 'in process' or 'complete'

  9. #9
    Registered User
    Join Date
    07-15-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: When specific value entered in one column, fill date column automatically

    sorry - I think I'm a little delerious. What was the last code you sent supposed to do?
    Last edited by ekm; 10-10-2010 at 05:04 PM.

  10. #10
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: When specific value entered in one column, fill date column automatically

    It was supposed to add the dates when you did a fill (i.e. the target range was greater than I cell)

    The code below should do the deletes as well

    Please Login or Register  to view this content.

+ 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