Thebatfink
Active Member
- Joined
- Apr 8, 2007
- Messages
- 410
Hi,
I have defined some custom functions in one of my workbooks which trigger from a value in a single cell. I have a requirement to have these "turned off" in some instances to prevent accident calculation (to retain whatever is in the cells at the time of initial calculation as this could change with time - and capture someone changing the trigger cell accidentally) so came up with an idea to incorporate a toggle button onto the worksheet.
My idea was simply adding the following line at the top of the function..
The code works as expected and exits the function early however the cells continue to update and populate with zeros
Is there a way I can trap this and prevent these particular cells (and ONLY these cells and NOT the whole workbook) containing the custom functions from updating and retain their value even if the trigger cell is changed? (My only other idea is to copy and paste special the values of the cells triggered by the toggle false, and then rewrite the formulas to the cells toggle true. Preventing the updating would be cleaner though I think?)
Thanks!
Batfink
I have defined some custom functions in one of my workbooks which trigger from a value in a single cell. I have a requirement to have these "turned off" in some instances to prevent accident calculation (to retain whatever is in the cells at the time of initial calculation as this could change with time - and capture someone changing the trigger cell accidentally) so came up with an idea to incorporate a toggle button onto the worksheet.
My idea was simply adding the following line at the top of the function..
Code:
If toggle.Value = False then Exit Function
The code works as expected and exits the function early however the cells continue to update and populate with zeros
Is there a way I can trap this and prevent these particular cells (and ONLY these cells and NOT the whole workbook) containing the custom functions from updating and retain their value even if the trigger cell is changed? (My only other idea is to copy and paste special the values of the cells triggered by the toggle false, and then rewrite the formulas to the cells toggle true. Preventing the updating would be cleaner though I think?)
Thanks!
Batfink