Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Atlanta, Georgia, USA
    Posts
    274
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Code Help (Excel 2000)

    I'm trying to get the text "Record Changed" to appear in
    column H of the row where the data was changed(A1 through D10). I don't know all the syntax for VBA in excel but tried Offset
    because it looked like it does what I needed.
    It keeps the text in the same row but doesn't keep it in column H.



    <pre>Private Sub Worksheet_Change(ByVal Target As Range)

    If Not Intersect(Target, Range("A110")) Is Nothing Then
    With Range(Target.Address).Offset(, 7)
    .Cells = "Record Changed"
    End With
    End If
    End Sub</pre>


  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Code Help (Excel 2000)

    .Offset(, 7) is the cell 7 columns to the right of the "Target" cell. Try this:

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim oCell As Range
    If Not Intersect(Target, Range("A110")) Is Nothing Then
    For Each oCell In Intersect(Target, Range("A110")).Cells
    Cells(oCell.Row, 8) = "Record Changed"
    Next oCell
    End If
    End Sub

  3. #3
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Atlanta, Georgia, USA
    Posts
    274
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Code Help (Excel 2000)

    Thanks,
    That did the trick.
    Scott

Posting Permissions

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