Delete key not activating Worksheet_Change procedure

BigDelGooner

Board Regular
Joined
Aug 17, 2009
Messages
197
Hi all

The code below works fine when I change a value in cells B6,B7 or B8 but when I delete a value in these cells using the delete key the procedure is not activated. I presume its that the delete key command is effectively classed as a ClearContents and not an actual change, any ideas on a workaround for this though?

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$B$6" Then
FrontPage_Summary
End If

If Target.Address = "$B$7" Then
FrontPage_Summary
End If

If Target.Address = "$B$8" Then
FrontPage_Summary
End If
End Sub
 
FrontPage_Summary is just a procedure I have in module1 that manipulates data in another sheet. Although even if I replace this with a simple msgbox it still doesnt work..
 
Upvote 0

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Funny, because this works for me:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$B$6" Then
MsgBox Target.Address ' FrontPage_Summary
End If

If Target.Address = "$B$7" Then
MsgBox Target.Address 'FrontPage_Summary
End If

If Target.Address = "$B$8" Then
MsgBox Target.Address 'FrontPage_Summary
End If
End Sub
 
Upvote 0
Placed the breakpoint and it does activate the code but does not recognised the address...which has led me closer to the answer. B6 is actually merged with cell C6!!
 
Upvote 0
**** those merged cells!! I really should have known better!!

Thank you, as always, for your support guys.

Have a good day.
 
Upvote 0
Try

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("B6:B8")) Is Nothing Then Exit Sub
FrontPage_Summary
End Sub
 
Upvote 0
Would it be correct that the rationale behind it not working is that in a merged cell the Target.Address would be "B6:C6"?

I had an involuntary run in with a merged cell once. Luckily you guys could figure out what had happened. They really are the spawn of the Nether regions.
 
Upvote 0
No because I setup a variable to check the address of the the target cell and it still said $B$6...just going to put it down as a merged cellism :)
 
Upvote 0

Forum statistics

Threads
1,216,098
Messages
6,128,812
Members
449,468
Latest member
AGreen17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top