raven_squire
Board Regular
- Joined
- Jan 13, 2013
- Messages
- 99
Hello,
In my code I have a global variable that gets calculated when the workbook opens. A macro copies data that the user has entered into a table based on the value of the variable. Then it changes the value of the variable each time it runs. The Macro is triggered when the user makes changes to cretin parts of the spreadsheet.
I have noticed that occasionally data is being copped over the column names of the table. I have noticed it happens after different macro error events or the reset button is pressed. This seams to reset the variable to 0 causing the data to be copied over the column names of the table.
Is there a way of making sure that the value of the variable is not ever lost?
I had thought about placing the value in a cell but that seams like a dirty fix. I also don't have a convenient place to put the variable.
Just wondering what the best practice is in this situation??
Thanks
In my code I have a global variable that gets calculated when the workbook opens. A macro copies data that the user has entered into a table based on the value of the variable. Then it changes the value of the variable each time it runs. The Macro is triggered when the user makes changes to cretin parts of the spreadsheet.
I have noticed that occasionally data is being copped over the column names of the table. I have noticed it happens after different macro error events or the reset button is pressed. This seams to reset the variable to 0 causing the data to be copied over the column names of the table.
Is there a way of making sure that the value of the variable is not ever lost?
I had thought about placing the value in a cell but that seams like a dirty fix. I also don't have a convenient place to put the variable.
Just wondering what the best practice is in this situation??
Thanks