Hello All,
I am hoping someone might be able to help with some VBA to apply custom formatting for a text box on an user form.
I have a user form called, "controlpanel". I use the AFterUpdate event on a text box with this line of VBA
Where controlpanel is the name of the user form and startreserve_textbox is the name of the text box on the form. This works fine. When the user makes a change to that text box, it updates the ControlSource and applies the currency format to the text in the text box.
Now, what I would like to do is be able to apply that formatting from the worksheet. In other words, if the user were to update the cell itself (on the worksheet) use the change event on the worksheet to apply formatting to the user form text box. However, when I insert the above code as a change event in the worksheet, nothing happens. It updates the text value in the in the user form text box, but it does not apply formatting.
If someone could explain the error of my ways, I would greatly appreciate it.
Regards,
Steve
I am hoping someone might be able to help with some VBA to apply custom formatting for a text box on an user form.
I have a user form called, "controlpanel". I use the AFterUpdate event on a text box with this line of VBA
Code:
controlpanel.startreserve_textbox.Value = Format$(controlpanel.startreserve_textbox.Value, "$##,###,##0")
Where controlpanel is the name of the user form and startreserve_textbox is the name of the text box on the form. This works fine. When the user makes a change to that text box, it updates the ControlSource and applies the currency format to the text in the text box.
Now, what I would like to do is be able to apply that formatting from the worksheet. In other words, if the user were to update the cell itself (on the worksheet) use the change event on the worksheet to apply formatting to the user form text box. However, when I insert the above code as a change event in the worksheet, nothing happens. It updates the text value in the in the user form text box, but it does not apply formatting.
If someone could explain the error of my ways, I would greatly appreciate it.
Regards,
Steve
Last edited: