Solved

VBA : Get contents of cell changed

Posted on 2012-03-23
2
375 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 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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

740 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