• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 381
  • Last Modified:

VBA : Get contents of cell changed

I'm using the Worksheet Change events to detect changes to cells.

I need to pass in the contents of the cell changed if the column is the third column.

What's the best way to do this?

Lee
0
lee_jd
Asked:
lee_jd
1 Solution
 
Rory ArchibaldCommented:
Do you mean the contents before the change or after?
0
 
regmigrantCommented:
Assuming you are looking at the content after the change, and you're not interested in changes as the result of a recalculation of the sheet then this example might help.

Its taken from the excel help for 'worsheet.change' and its easy to see how to get it to work with column 3

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    If Target.Column = 3 Then
        ThisRow = Target.Row
         
        Target.value  holds the new value of the cell

    End If
End Sub

If you need something more complex then an example would help
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now