is there such an event as cell change

hitch_hiker

Active Member
Joined
Feb 21, 2012
Messages
267
I need to do data manipulation based on a particular cell being changed, I can try to work it on sheet change , but cell change would be a lot easier, if it is possible , please advise correct syntax also best location to put the code
 

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
22,794
The usual way to restrict the sheet's change event to particular cells is
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Application.Intersect(Target, Range("C10:C16")) Is Nothing Then
        Rem do stuff
    End If
End Sub
Note that if you copy paste, Target might be more than one cell
 

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
Here's something you can start with..

On the sheet you want to do this action, Right click it's Tab - View code.
Paste the following there.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim MyRange As Range, c As Range
Set MyRange = Intersect(Target, Range("C10:C16"))
If MyRange Is Nothing Then Exit Sub
Application.EnableEvents = False
For Each c In MyRange
    c.Offset(0, 1).Value = "Cell " & c.Address & " was just changed"
Next
Application.EnableEvents = True
End Sub
 

hitch_hiker

Active Member
Joined
Feb 21, 2012
Messages
267
thanks Mike, so it's a sheet change but only if in the range, why the private sub?, does that make a difference.
 

hitch_hiker

Active Member
Joined
Feb 21, 2012
Messages
267
thanks Jon,
I might be biting much more than I can chew, but it's the finishing touch for my project
 

Forum statistics

Threads
1,082,131
Messages
5,363,337
Members
400,726
Latest member
Shahzad Taimoor

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top