View Numbers in Textbox in Proper Format in UserForm

S

shahzad4u_ksa

Hi,

I have one Userform having Textbox2 to show the Value of the Total
amount from the worksheet.

I mean in Sheet1, B3 there is written 34,540.00 and I want to
show this value exactly in UserForm,

I connected to the textbox2 in UserForm, but my problem is this, it
is showing like this 34540.00 this is not proper format.

it should be 34,540.00 (with comma).

Kindly advise me how fix this problem.

Thanks and regards.

Shahzad
Madinah
 
N

Norman Jones

Hi Shahzad4u,

Try using the TextBox's Text property,
rather than its value property.

Therfore, try, for example, somthing like:

'=========>>
Private Sub UserForm_Initialize()
Dim WB As Workbook
Dim SH As Worksheet

Set WB = thisworkboook
Set SH = WB.Sheets("Sheet1") '<<==== CHANGE

Me.TextBox1.Value = ActiveSheet.Range("A1").Text

End Sub
'<<=========
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top