Gringoire
Board Regular
- Joined
- Nov 18, 2016
- Messages
- 71
- Office Version
- 365
- Platform
- Windows
Hi guys,
I found a strange behavior on my excel workbook.
There is an hidden sheet (below) used as support to save list for filling listboxes active controls (shown in other sheets) and/or saving information.
Some of these are simple range, someone are named ranges and one is a table:
The strange thing is that, when I add a row to the orange table that is used by ONLY ONE of my listboxes,
this create a Change() event on ALL the listboxes having their RowSource property linked to some list in this Sheet.
Anyway, my code works properly, but I would like to avoid to trig useless Change() events on controls that have not been modified, because it could lead to unexpected errors.
I know that it is possible to use Application.EnableEvents property to handle this issue, but I would like to understand why it happens before make my code more complex if not necessary...
thank you.
I found a strange behavior on my excel workbook.
There is an hidden sheet (below) used as support to save list for filling listboxes active controls (shown in other sheets) and/or saving information.
Some of these are simple range, someone are named ranges and one is a table:
The strange thing is that, when I add a row to the orange table that is used by ONLY ONE of my listboxes,
VBA Code:
'Aggiorno la lista commesse
With shDEV_Utilities.ListObjects("Tab_consuntivi")
Dim addedRow As ListRow
Set addedRow = .ListRows.Add()
With addedRow
.Range(1) = jobn
End With
.Sort.SortFields.Clear 'elimino eventuali sort precedenti
.Sort.SortFields.Add2 Key:=.ListColumns(1).Range
.Sort.Apply
End With
Anyway, my code works properly, but I would like to avoid to trig useless Change() events on controls that have not been modified, because it could lead to unexpected errors.
I know that it is possible to use Application.EnableEvents property to handle this issue, but I would like to understand why it happens before make my code more complex if not necessary...
thank you.