Basically that's my question. I have comboBoxes that affect other ComboBoxes on change and that's all perfect, but I have a need to be able to get the value back from cell to ComboBox on a separate Excel file open and like iI have it written now - it triggers change ComboBox and affects other ComboBoxes which now will be empty and that's bad. What I basically need is to maintain selected items in ComboBoxes once opening the saved workbook once again.
The way I have it written from ComboBox to Sheet:
'Paste value to sheet
Worksheets("Machine Specification").Range("C4").Value = UserForm_TVPM.Language_ComboBox.Text
And the way I get it loaded back to ComboBox from sheet:
UserForm_TVPM.Language_ComboBox.Value = Worksheets("Machine Specification").Range("C4").Value
Same issue occurs upon unloading and showing the UserForm. SInce I have to populate the now empty ComboBoxes.
Could someone, help me solve this problem, please?
P.S.
I have a module that has many subroutines with load functions such as provided in the original post for each userform. That's how I get the value from cell to combobox. AND I have a userform initialize subroutine that mostly has additem function for all the comboboxes in said userform. Later on while user is working with the file - all is fine as I can hide userforms without losing the date in it's combopboxes, BUT upon unloading the userform in any way (weather closing the workbook or simply going to another userform that unloads the previous) the data will be lost and on next initialize of the userform will be loaded back in. Because I have comboboxes that items are dependant on selection in some other combobox - in this scenario I lose the calculated value in userform AND in worksheet.
My understanding is that it happens because upon loading the userform, it's all blank, and upon loading the values it triggers each combobox change event causing some dependant combobox items to be cleared recalculated to provide a correct range of options to select from, and that in turn deletes the dependant comboboxes value in the worksheet because of the transferring combobox value to worksheet. So I generally need to maintain all the combobox values as they were sent to worksheet upon loading a userform, much like it would be if I were to hide a userform and then show it again. :)
Application.EnableEvents
does not disable events from user forms and its controls but only events from the worksheets. – Pᴇʜ