+ Reply to Thread
Results 1 to 2 of 2

Changing data in a cell when other data is changed

Hybrid View

  1. #1
    Registered User
    Join Date
    03-27-2008
    Posts
    3

    Changing data in a cell when other data is changed

    Hi all, I've got a worksheet where I want a value in column G to change to today's date when the data is changed in the same row in Column F. It's a dropdown in column F, but I don't think that matters. This is what I've got so far, and I'm a bit stumped

    Private Sub Worksheet_change(ByVal Target As Range)
    If Not Application.Intersect(Target, "F5:F60") Is Nothing Then
    If Target.Cells.Count > 1 Then
    Exit Sub
    Else
    Dim iCurrentRow As Integer
    iCurrentRow = Target.Row
    Set Form(G, iCurrentRow) = TODAY()

    Else 'nothing changes if the status doesnt change
    Exit Sub


    End Sub




    I'm stuck on that Set Form row there, I know it's kind of wrong, but this is my best guess, I'm not sure how to use that iCurrentRow properly, or how to change the data in a cell from this page. Any help would be great, thanks!

  2. #2
    Forum Contributor
    Join Date
    04-21-2007
    Location
    Lima, Peru
    MS-Off Ver
    2000, 2007, 2010
    Posts
    674

    Auto change date

    HI

    If you try the amended code this ahould work okay. As NOW returns the value of a timestamp you will need to format the destination cells to whatever date format you need

    Private Sub Worksheet_change(ByVal Target As Range)
    
    If Not Application.Intersect(Target, Range("F5:F60")) Is Nothing Then
    Let Cells(Target.Row, 7) = Now()
    End If
    
    End Sub
    regards

    Jeff

+ 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