Detect a change in a Form

AlexanderBB

Well-known Member
Joined
Jul 1, 2009
Messages
2,120
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
My form sets up various parameters which are stored and used later. The user can change these to their preferences.
When the Forms closed I ask Save Yes/No. But I don;t need to if nothing's changed.
Is there anyway to know that without comparing every item. There's about 30 items that could change.
I'm petty sure there's not... but... ??
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
When you say that the user can change those parameters to their preferences, I'm assuming via code, correct? If so, you could declared a module-level Boolean variable to track whether a change has been made to the UserForm. So, when a change to a parameter is made, you would assign True to your Boolean variable. And, when the UserForm closes, you would first check the variable to see if a change has been made. If so, then you would ask whether to save.

Hope this helps!
 
Upvote 0
That's what I thought... meaning the boolean would need to be set on every change possible.
 
Upvote 0

Forum statistics

Threads
1,225,760
Messages
6,186,874
Members
453,381
Latest member
tcell

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top