Skip to Content
0
May 18, 2016 at 06:16 PM

VBA to exit save macro if system produces "there is no data to save" message

99 Views

Hi Experts,

Would appreciate a lot your help with one question. I am working on a template that does the following: 1. Tab A submits data to the system; 2. Tab B is retrieving calculated values from the system. There's a validation built in to compare values between Tab A and Tab B. Thus, I have a macro that saves data to the system from Tab A, then goes to Tab B and refreshes it for validation purposes. However, if data on Tab A has not been changed, the system produces a message "There's no data to save", then Tab B is getting refreshed. I'd like to add a condition to the macro, so that if system produces the message "There's no data to save", the macro would be exited instead of proceeding with Tab B refresh. Is there a way to accomplish this? (I don't know how to capture the system message "There's no data to save" in VBA as a condition to trigger macro exit). Any help would be greatly appreciated!