Solved

VBA : Get contents of cell changed

Posted on 2012-03-23
2
366 Views
Last Modified: 2012-03-29
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
Comment
Question by:lee_jd
2 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 37756495
Do you mean the contents before the change or after?
0
 
LVL 19

Accepted Solution

by:
regmigrant earned 500 total points
ID: 37756920
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now