![]() |
Worksheet Change Event
What is the best way of identifying if the worksheet change event was triggered by anything other than a change in the contents of a cell? I want to be able to handle cell changes but am not interested in other events such as inserting/deleting rows etc and want to exit the sub in these situations. The solution presumably involves some sort of test on the 'target' range. Any ideas? -- blatham ------------------------------------------------------------------------ blatham's Profile: http://www.excelforum.com/member.php...o&userid=19441 View this thread: http://www.excelforum.com/showthread...hreadid=483668 |
Worksheet Change Event
suggestion,
Keep track of the current activecell of selection value maybe? using the worksheetchangeselection event -- When you lose your mind, you free your life. "blatham" wrote: What is the best way of identifying if the worksheet change event was triggered by anything other than a change in the contents of a cell? I want to be able to handle cell changes but am not interested in other events such as inserting/deleting rows etc and want to exit the sub in these situations. The solution presumably involves some sort of test on the 'target' range. Any ideas? -- blatham ------------------------------------------------------------------------ blatham's Profile: http://www.excelforum.com/member.php...o&userid=19441 View this thread: http://www.excelforum.com/showthread...hreadid=483668 |
Worksheet Change Event
Test Target.Count. If a row is inserted/deleted then Target.Count will
be 256. If a column is inserted/deleted it will be 65536. If a single cell is changed it will be 1. Hope this helps Rowan blatham wrote: What is the best way of identifying if the worksheet change event was triggered by anything other than a change in the contents of a cell? I want to be able to handle cell changes but am not interested in other events such as inserting/deleting rows etc and want to exit the sub in these situations. The solution presumably involves some sort of test on the 'target' range. Any ideas? |
Worksheet Change Event
Yeh that's good for highlighting a column or row deletion or insertion. I could do with knowing whether individual cells have bee inserted/deleted too (the target.cells.count for these situations wil be 1 when this happens too). Any other ideas -- blatha ----------------------------------------------------------------------- blatham's Profile: http://www.excelforum.com/member.php...fo&userid=1944 View this thread: http://www.excelforum.com/showthread.php?threadid=48366 |
Worksheet Change Event
Hi Rowan,
I do not think that the Worksheet_Change event responds to the insertion of a row or a column. Also, I do not think that the event distinguishes between the deletion of rows or columns and value changes to the entire row/column. --- Regards, Norman "Rowan Drummond" wrote in message ... Test Target.Count. If a row is inserted/deleted then Target.Count will be 256. If a column is inserted/deleted it will be 65536. If a single cell is changed it will be 1. Hope this helps Rowan blatham wrote: What is the best way of identifying if the worksheet change event was triggered by anything other than a change in the contents of a cell? I want to be able to handle cell changes but am not interested in other events such as inserting/deleting rows etc and want to exit the sub in these situations. The solution presumably involves some sort of test on the 'target' range. Any ideas? |
Worksheet Change Event
Hi Norman The worksheet change event does respond to column/row and cell insertions/deletions. My original question was whether or not in the code of the event you coud establish whether the event was triggered as a result of a change in the contents of a cell or something else (e.g. inserts/deletes). -- blatham ------------------------------------------------------------------------ blatham's Profile: http://www.excelforum.com/member.php...o&userid=19441 View this thread: http://www.excelforum.com/showthread...hreadid=483668 |
Worksheet Change Event
Hi B,
The worksheet change event does respond to column/row and cell insertions/deletions. I agree that deletions trigger the change event; I suggested that (for me) row/column insertions did not. Is your experience different and, if so, what version are you using? --- Regards, Norman "blatham" wrote in message ... Hi Norman The worksheet change event does respond to column/row and cell insertions/deletions. My original question was whether or not in the code of the event you coud establish whether the event was triggered as a result of a change in the contents of a cell or something else (e.g. inserts/deletes). -- blatham ------------------------------------------------------------------------ blatham's Profile: http://www.excelforum.com/member.php...o&userid=19441 View this thread: http://www.excelforum.com/showthread...hreadid=483668 |
Worksheet Change Event
It is certainly the case in 2002 & 2003. Be -- blatha ----------------------------------------------------------------------- blatham's Profile: http://www.excelforum.com/member.php...fo&userid=1944 View this thread: http://www.excelforum.com/showthread.php?threadid=48366 |
All times are GMT +1. The time now is 01:54 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com