If you have other control types that might have a Yes tag that you want to exclude, then test the type:
Code:
PrivateSub UserForm_Initialize()
For Each Ctrl In Controls
If TypeOf Ctrl Is MSForms.Textbox and Ctrl.Tag = "Yes" Then Ctrl.value = format(Date,"dd-mm-yyyy")
next Ctrl
end sub
Hi Yaser and Debaser, thanks for the quick reply.
The combination of both answers did the trick.
I tryed the code of debraser this morning but without MSForms
Did't work.
I tryed Yasser sugestion
Didn'work
But the combination of both works
Using MSforms in the code and using integer as tag.
My problem is solved.
Have a nice day.