Excel 2007 VBA: Event refires after the same event procedure ends -


private sub workbook_sheetchange(byval sh object, byval source range)     application.enableevents = false      ' code      application.enableevents = true  end sub 

the "some code" used trap when user has pasted value in cell. if paste came after copy operation procedures works correctly. if paste value came after cut operation after execution reaches end sub procedures starts again , cannot determine change occuring cause refire.

the source , destination cells formatted data validation.

try , can see first event fired range cut, , second paste destination.

private sub workbook_sheetchange(byval sh object, byval source range)      application.enableevents = false      debug.print sh.name, source.address()      application.enableevents = true  end sub 

Comments

Popular posts from this blog

How to run C# code using mono without Xamarin in Android? -

c# - SharpSsh Command Execution -

python - Specify path of savefig with pylab or matplotlib -