• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

run macro if specific cell is changed is not working - it catches any cell changed

k1s

Member
Hi,

I've got bunch of code that I want to run when a specific cell is changed so the Sub starts:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Application.Intersect(Target, Target.Worksheet.Range("D6")) Is Nothing Then

'run rest of code...

Can anybody think why this wouldn't just catch changes in the cell D6?

For me the rest of the code runs if any cell on the sheet is changed.
 
Hi,

I've got bunch of code that I want to run when a specific cell is changed so the Sub starts:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Application.Intersect(Target, Target.Worksheet.Range("D6")) Is Nothing Then

'run rest of code...

Can anybody think why this wouldn't just catch changes in the cell D6?

For me the rest of the code runs if any cell on the sheet is changed.
Hi,

Try:
Code:
    If Not Intersect(Target, Range("D6")) Is Nothing Then

Hope this helps
 
Back
Top