?
Solved

VBA : Get contents of cell changed

Posted on 2012-03-23
2
Medium Priority
?
377 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 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