View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bill Manville Bill Manville is offline
external usenet poster
 
Posts: 473
Default Formatting for Numbers & Currency in textbox

Dugless wrote:
Private Sub t_salary_Change()

t_salary.Value = Format(t_salary.Value, "$#,##0")

End Sub

This appeared to work however when a certain amount of memory was used
(or when the PC felt like it) this created an infinite loop


Try this

Dim ItsMe As Boolean ' at top of module

Private Sub t_salary_Change()
If ItsMe Then Exit Sub
ItsMe = True
t_salary.Value = Format(t_salary.Value, "$#,##0")
ItsMe = False
End Sub


Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup