Create Userform but description doesn't show correctly.

kitsa

Board Regular
Joined
Mar 4, 2016
Messages
111
Office Version
  1. 365
  2. 2016
Hi I'm using Userform, but unable to change the image to show Dates, dollars figures and decimal points.
How do I fix this on VBA?

Userform.JPG


VBA Code:
Private Sub cmdEdit_Click()

 If Selected_List = 0 Then

MsgBox "No row is selected.", vbOKOnly + vbInformation, "Edit"

Exit Sub

End If

'Code to update the value to respective controls



Me.TxtRowNumber.Value = Selected_List - 1

Me.TxtDate.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 0)
Me.TxtNo.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 1)
Me.CmbConVar.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 2)
Me.TxtQuoteNo.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 3)
Me.TxtItemNo.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 4)
Me.TxtArea.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 5)
Me.TxtDes1.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 6)
Me.TxtDes2.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 7)
Me.TxtHeight.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 8)
Me.TxtLength.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 9)
Me.TxtLevels.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 10)
Me.TxtErect.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 11)
Me.TxtHUI1.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 12)
Me.TxtHUI2.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 13)
Me.TxtHUI3.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 14)
Me.TxtSTD.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 15)
Me.TxtLCS.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 16)
Me.TxtIB.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 17)
Me.txtTMNo.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 18)
Me.TxtTM.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 19)
Me.TxtHUMNo.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 20)
Me.TxtHUM.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 21)
Me.TxtDismantle.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 22)
Me.TxtTransport.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 23)
Me.TxtSCS.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 24)
Me.TxtSundry.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 25)
Me.TxtSupplyBeams.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 26)
Me.TxtOthers.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 27)
Me.TxtENG.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 28)
Me.TxtHire.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 29)
Me.TxtHireWeeks.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 30)
Me.TxtOH.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 31)
Me.TxtWklyHire.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 32)
Me.TxtTotal.Value = Me.lstdatabase.List(Me.lstdatabase.ListIndex, 33)

MsgBox "Please make the required changes and click on 'Save' button to update.", vbOKOnly + vbInformation, "Edit"



End Sub
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Check out the following couple of examples:

VBA Code:
Me.TxtDate.Value = Format(Me.lstdatabase.List(Me.lstdatabase.ListIndex, 0), "dd/mm/yyyy")

Me.TxtTotal.Value = Format(Me.lstdatabase.List(Me.lstdatabase.ListIndex, 33), "#,##0.00")
 
Upvote 0
I'm glad to help you. Thanks for the feedback.
 
Upvote 0
I have the same form and need to get the comment in cells and show them in a textbox inside the form (each comment will have its own textbox in the form).
Can you help me?


Check out the following couple of examples:

VBA Code:
Me.TxtDate.Value = Format(Me.lstdatabase.List(Me.lstdatabase.ListIndex, 0), "dd/mm/yyyy")

Me.TxtTotal.Value = Format(Me.lstdatabase.List(Me.lstdatabase.ListIndex, 33), "#,##0.00")
 
Upvote 0
Maybe it is the same form, but what you are asking for is different from this thread.
Create a new thread and explain in detail (sheet name, cells, textbox name, etc) and with an image what you need.
 
Upvote 0
Hi,

Thank you for your answer.
I already have created a new thread, you can see it here:

Thanks.
Maybe it is the same form, but what you are asking for is different from this thread.
Create a new thread and explain in detail (sheet name, cells, textbox name, etc) and with an image what you need.
 
Upvote 0

Forum statistics

Threads
1,215,133
Messages
6,123,233
Members
449,092
Latest member
SCleaveland

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top