G
Guest
Hi,
I have an application where new data is pasted into a worksheet, and since
the data changes slightly each time, the data types need to be reset after
each import. I have VBA code to reformat the data types based on what is in
the newly imported data.
I need to run this reformatting before the workbook recalculates, otherwise
there are errors that can occur in using this new data.
I had included the reformat code in Worksheet_Change, and found that this
runs after the recalculation is completed. I have tried this in other events
also with the same result.
I have also tried trapping the resulting error (13 - type mismatch) and then
having the error logic run the reformat code. This didn't work either, as
the data types will not update when run at this time. I'm thinking it is
due to being withn the recalculation step, though I'm not sure.
I considered setting recalculation to manual, however, since an end user
could change the setting back to automatic, I wanted to find another way
around this.
Any ideas on how this can be handled?
Thanks!
I have an application where new data is pasted into a worksheet, and since
the data changes slightly each time, the data types need to be reset after
each import. I have VBA code to reformat the data types based on what is in
the newly imported data.
I need to run this reformatting before the workbook recalculates, otherwise
there are errors that can occur in using this new data.
I had included the reformat code in Worksheet_Change, and found that this
runs after the recalculation is completed. I have tried this in other events
also with the same result.
I have also tried trapping the resulting error (13 - type mismatch) and then
having the error logic run the reformat code. This didn't work either, as
the data types will not update when run at this time. I'm thinking it is
due to being withn the recalculation step, though I'm not sure.
I considered setting recalculation to manual, however, since an end user
could change the setting back to automatic, I wanted to find another way
around this.
Any ideas on how this can be handled?
Thanks!