• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Listbox to textbox currency code required

LearningEXL

New Member
Hi all im still pretty new to all this.

i have a listbox "Listbox1" and a textbox "txt_Cost" but how do i get my textbox to display numbers as currency please
 
Hi ,

Why do mention the ListBox and the TextBox together ? Are they related in any way ?

Where is the TextBox getting its data from ? Is the user inputting a number into the TextBox which you then want to be displayed in Currency format ?

Is the TextBox in a worksheet or is it in a UserForm ?

Narayan
 
Hi ,

There are too many controls and too much of code for me to sift through everything.

Can you be more specific , and give the name of the procedure and the name of the textbox where you wish to display an amount in currency format ?

Narayan
 
Hi ,

I cannot run anything because certain controls are missing at my end ; is it the textboxes Txt_ST or Txt_ET ?

Narayan
 
Hi ,

At two places , the TextBoxes are being assigned values as follows :

Me.Txt_ST.Value = Me.ListBox1.Column(4)
Me.Txt_ET.Value = Me.ListBox1.Column(5)

and

Me.Txt_ST.Value = Me.ListBox1.Column(5)
Me.Txt_ET.Value = Me.ListBox1.Column(6)

What do these columns contain ?

Can you not use the Format function here with the appropriate format string to convert the ListBox value to currency format before assigning it to the TextBox ?

Narayan
 
think you are looking at the wrong sheet its the other agency sheet you need to look at. the one that shows currenty i think its agency contractors userform you need to look at. referencing currency
 
Hi ,

I think the principle remains the same ; looking at the form you have mentioned , it has the following textboxes :
Code:
Me.Txt_Agency.Value = Me.ListBox1.Value
Me.Txt_Contract_Name.Value = Me.ListBox1.Column(1)
Me.Txt_Con_Addy_St.Value = Me.ListBox1.Column(2)
Me.Txt_Con_Addy_Twn.Value = Me.ListBox1.Column(3)
Me.Txt_Con_PostCode.Value = Me.ListBox1.Column(4)
Me.Txt_Con_Number.Value = Me.ListBox1.Column(5)
Me.Txt_Mobile_Number.Value = Me.ListBox1.Column(6)
Me.Txt_NFRMFD.Value = Me.ListBox1.Column(7)
Me.Txt_NFRMFN.Value = Me.ListBox1.Column(8)
Me.Txt_NFRSDR.Value = Me.ListBox1.Column(9)
Me.Txt_NFRSNR.Value = Me.ListBox1.Column(10)
Me.Txt_NFRSunDR.Value = Me.ListBox1.Column(11)
Me.Txt_NFRSunNR.Value = Me.ListBox1.Column(12)
Me.Txt_MFD.Value = Me.ListBox1.Column(13)
Me.Txt_MFN.Value = Me.ListBox1.Column(14)
Me.Txt_SDR.Value = Me.ListBox1.Column(15)
Me.Txt_SNR.Value = Me.ListBox1.Column(16)
Me.Txt_SunDR.Value = Me.ListBox1.Column(17)
Me.Txt_SunNR.Value = Me.ListBox1.Column(18)
Me.Txt_NoRate.Value = Me.ListBox1.Column(19)
Me.txt_Notes.Value = Me.ListBox1.Column(20)
Me.txtID.Value = Me.ListBox1.Column(21)
Which ever one of these textboxes needs to display an amount in currency format , use the Format function to convert the ListBox value to the desired format before transferring it to the respective textbox.

Narayan
 
Back
Top