ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   format textbox in userform (https://www.excelbanter.com/excel-programming/321451-format-textbox-userform.html)

jeffP

format textbox in userform
 
Got me stuck. I have some textboxes in a userform that I would like to show
in certain various formats. Most are linked to a control source and I
"thought" if I formatted the controlsource....but not so.

Any help in how to do this would be appreciated
Tia



Dave Peterson[_5_]

format textbox in userform
 
I think I'd drop the controlsource and just format it the way I wanted:

Option Explicit
Private Sub UserForm_Initialize()
Me.TextBox1.Value = Format(Worksheets("sheet1").Range("a1").Value, "$0.00")
End Sub

or even
Option Explicit
Private Sub UserForm_Initialize()
Me.TextBox1.Value = Worksheets("sheet1").Range("a1").Text
End Sub


jeffP wrote:

Got me stuck. I have some textboxes in a userform that I would like to show
in certain various formats. Most are linked to a control source and I
"thought" if I formatted the controlsource....but not so.

Any help in how to do this would be appreciated
Tia



--

Dave Peterson


All times are GMT +1. The time now is 12:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com