Hello,
I have a userform with a bunch textboxes. I would like to format most of them as numbers with no decimals. The group of textboxes I would like formatted in this manner are consecutively numbered. I have the below code, which works, however, it is extremely cumbersome given the number of textboxes.
I am searching for code to format this consecutive range of textboxes (422-481) as a number upon being updated. Have not been able to find anything that accomplishes this. Any help simplfying this would be greatly appreciated.
I have a userform with a bunch textboxes. I would like to format most of them as numbers with no decimals. The group of textboxes I would like formatted in this manner are consecutively numbered. I have the below code, which works, however, it is extremely cumbersome given the number of textboxes.
I am searching for code to format this consecutive range of textboxes (422-481) as a number upon being updated. Have not been able to find anything that accomplishes this. Any help simplfying this would be greatly appreciated.
Code:
Private Sub TextBox422_AfterUpdate() <wbr> If Textbox422 <> ""Then textbox422 = FormatNumber(Textbox422, 0)
Private Sub TextBox423_AfterUpdate() <wbr> If Textbox423 <> ""Then textbox423 = FormatNumber(Textbox423, 0)
Private Sub TextBox424_AfterUpdate() <wbr> If Textbox424 <> ""Then textbox424 = FormatNumber(Textbox424, 0)
Private Sub TextBox425_AfterUpdate() <wbr> If Textbox425 <> ""Then textbox425 = FormatNumber(Textbox425, 0)
Private Sub TextBox426_AfterUpdate() <wbr> If Textbox426 <> ""Then textbox426 = FormatNumber(Textbox426, 0)
Private Sub TextBox427_AfterUpdate() <wbr> If Textbox427 <> ""Then textbox427 = FormatNumber(Textbox427, 0)
Private Sub TextBox428_AfterUpdate() <wbr> If Textbox428 <> ""Then textbox428 = FormatNumber(Textbox428, 0).....