Hi
I have this code for do a for each OptionButton in a frame
frameVarselTekniskeAlarmer = name of my frame.
I have lots of frames on my userforms and every frame have OptionButton, CheckBox, ComboBox.
So insted of make many of the same code as above, I hoped to maybe Reuse the same code in a function maybe?
Make one code that works for OptionButton, one for CheckBox, one for ComboBox and reuse this code on every userform that I need to use this code.
I'am not so good at vba excel and the code above I have find it with a google search
Hope someone understand what I mean here
I have this code for do a for each OptionButton in a frame
Code:
Dim ctrlOptionButton As Control
For Each ctrlOptionButton In frameVarselTekniskeAlarmer.Controls
If (TypeName(ctrlOptionButton) = "OptionButton") Then
ctrlOptionButton.Value = False
End If
Next
frameVarselTekniskeAlarmer = name of my frame.
I have lots of frames on my userforms and every frame have OptionButton, CheckBox, ComboBox.
So insted of make many of the same code as above, I hoped to maybe Reuse the same code in a function maybe?
Make one code that works for OptionButton, one for CheckBox, one for ComboBox and reuse this code on every userform that I need to use this code.
I'am not so good at vba excel and the code above I have find it with a google search
Hope someone understand what I mean here