Greetings,
I have started creating a userform with several textbox controls. The input in these textbox controls should be displayed either in the "Percent" or "Standard" format. Instead of having a code for each textbox control, I used the tag property "P" & "S" and put together this code:
But when I enter a number in the textbox control, the display does not change.![]()
Private Sub UserForm1_Initialize() Dim oCtrl As MSForms.control For Each oCtrl In Me.Controls If oCtrl.Tag = "P" Then oCtrl.Value = Format((oCtrl.Value) / 100, "Percent") If oCtrl.Tag = "S" Then oCtrl.Value = Format(oCtrl.Value, "Standard") End If End If Next oCtrl End Sub
Can someone please tell me what is wrong?
Many thanks
Asha
Bookmarks