on 02-20-2023 4:48 AM
Hello All,
I am trying to look for an event to call a macro when a user inserts /removes new characteristics in columns in AFO workbook. I have tried counting number of columns in a cell and try to use the worksheet_calculate event on cell change due to formula but it doesn't seem to work. I have also tried the API call back Callback_AfterRedisplay() but this too is not helping much. Is there any event that can be used.
Thanks in advance
Nikhil
nikhil_1486
Unfortunately, there is no built-in event for when a user inserts or removes columns in an AFO workbook. You will need to create your own custom solution to detect and respond to changes in the columns.
One approach you could use is to track changes in the column count using the workbook_calculate event. You can compare the column count before and after the event to determine if any columns were added or removed.
Another approach would be to use the API callback Callback_AfterRedisplay() to detect changes in the column count. This API callback will be triggered whenever the AFO window is refreshed, which should occur when columns are added or removed. You can then compare the column count before and after the callback to determine if any columns were added or removed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yoganandamuthaiah
I exactly tried the approaches you suggest but for some reason it does not work. I used an excel formula COUNTA() to get the count of columns in a cell and then used worksheet_calculate () event of the worksheet on this cell to check old and new value of the cell to trigger the macro. If I manually change the value in this cell it works but not when the cell value changes due to formula. I even tried the Callback_AfterRedisplay() to get a trigger but this will fire only when a refresh is done but i want to get my macro before refresh.
Nikhil
User | Count |
---|---|
77 | |
9 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.