hI,
I have a file with data matrix table in one of the sheets.
There is also button that does the calculation and presents the report placed in other sheet, but only if user change some data in matrix (recalculation takes some time, so I do not want to do it, if no changes in data matrix have been done).
So I have created Worksheet_Change event in matrix sheet with setting 'matrix_update' variable to TRUE
The macro assigned to the button checks out at first if variable 'matrix_update' is sets to TRUE.
If yes - then do the calculations.
It works good, but...
If the user change some data in matrix, without accepting this by Enter key (or other), the variable 'matrix_update' is not changed to YES and the macro do not do the calculations. But the data has been changed.
How to handle this?
Maybe I am able to disable button if the cell is in edition mode?
I have a file with data matrix table in one of the sheets.
There is also button that does the calculation and presents the report placed in other sheet, but only if user change some data in matrix (recalculation takes some time, so I do not want to do it, if no changes in data matrix have been done).
So I have created Worksheet_Change event in matrix sheet with setting 'matrix_update' variable to TRUE
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
matrix_update = True
End Sub
If yes - then do the calculations.
Code:
Sub do_calculations()
If matrix_update = True Then
'my macro
'my macro
'my macro
matrix_update = False
End If
End Sub
If the user change some data in matrix, without accepting this by Enter key (or other), the variable 'matrix_update' is not changed to YES and the macro do not do the calculations. But the data has been changed.
How to handle this?
Maybe I am able to disable button if the cell is in edition mode?