Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Jan 2007
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello again,

    I attached this sample a few days ago looking for help on a "current status" column. That is working very well.

    I have a new challenge. Please look at cell "S4" in the attachment. How can I write a code or insert a function so that everytime an action is made (drop down item selected) in cell "R4", S4 automatically updates to the current date (in mm/dd/yyyy format)? This date would have to be static as well. If R4 is blank, then S4 should be blank as well.

    Thanks again for your help!

    sulli101
    Attached Files Attached Files

  2. #2
    New Lounger
    Join Date
    Jan 2007
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Also, this function would need to be relative to others cells in that column for future entries in row 5, etc....

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You need VBA code for this:

    Right-click the sheet tab.
    Select View Code from the popup menu.
    Copy the following code into the worksheet module that appears:

    Code:
    rivate Sub Worksheet_Change(ByVal Target As Range)
      Dim oCell As Range
      If Not Intersect(Range("R4:R" & Rows.Count), Target) Is Nothing Then
    	Application.EnableEvents = False
    	For Each oCell In Intersect(Range("R4:R" & Rows.Count), Target).Cells
    	  If oCell = "" Then
    		oCell.Offset(0, 1).ClearContents
    	  Else
    		oCell.Offset(0, 1) = Date
    	  End If
    	Next oCell
    	Application.EnableEvents = True
      End If
    End Sub
    Note: a side effect of running this code is that changes in cells R4 and down cannot be undone.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •