Hello
I have userform as in attached, I need to correct in code, when I run userform and when I add in name as example RM44 in location (as many equipments in this location I need to show in this userform), and after I press button change it will give error as attached that this record already exists and repeat. My question how can I make userform to change in equipment ID (eqpt id) for one cell without giving this error message.
Regards,,
Hi,
When you write into:
Cells(sonsat, 2) = TextBox1
You have to disable events, because you are using a Sheet Change event. That event triggers another chain of events.
Use:
Application.EnableEvents=false
Cells(sonsat, 2) = TextBox1
Application.EnableEvents=true
You should also be careful when writing values into other controls in the form, because some of them have also actions associated to that control change event.
Disabling form events is different.