Hi gki,
Try something like:
Dim i As Long
Dim ctrl As Control
For Each ctrl In UserForm1.Controls
If TypeOf ctrl Is MSForms.TextBox Then
For i = 1 To 21
If ctrl.Name = "price0" & i Then
ctrl.Value = Format(ctrl.Value, "£#,##0.00")
End If
Next i
End If
Next
---
Regards,
Norman
"gki " wrote in message
...
Hello,
I am trying to format the textboxes on userform with the following
code, but I cannot see the problem why I cannot make it working....
For i=1 To 21
With "price0" & (i)
value=Format (.value, "£#,##0.00")
End With
Next i
my textbox names are : price01, price02, price03......
Please assist me to make it work,
Regards,
gki
---
Message posted from http://www.ExcelForum.com/