Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
formatting textboxes
I populate textboxes on a userform with the following code
Private Sub cmdEditChemical_Click() Dim Chemical As Variant Chemical = Sheets("Chemicals").Cells.Find(What:=lstChemicalDa tabase.Text, LookIn:=xlFormulas, _ LookAt:=1, SearchDirection:=xlNext, MatchCase:=False).Offset(0, 0).Address With Sheets("Chemicals").Range(Chemical) TextBoxName.Text = .Offset(0, 0) TextBoxCAS.Text = .Offset(0, 1) TextBoxMW.Text = .Offset(0, 2) TextBoxDensity.Text = .Offset(0, 3) TextBoxConc.Value = .Offset(0, 4) TextBoxMaterial.Text = .Offset(0, 5) TextBoxSupplier.Value = .Offset(0, 6) TextBoxPack.Value = .Offset(0, 7) TextBoxUnit.Value = .Offset(0, 8) TextBoxWasteClass.Value = .Offset(0, 9) TextBoxCost.Value = .Offset(0, 10) End With End Sub I need the textboxes to show particular formatting for example : TextBoxCost needs to be $0.00 format or TextBoxConc needs to be XX.X% format Can anyone help with the syntax of the code to help me with the formats? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
formatting textboxes
maybe this will point you in the right direction
Me.TextBox1.Value = Format(Worksheets("Sheet1").Range("A1").Value, "$0.00") -- Gary Keramidas Excel 2003 "Roger on Excel" wrote in message ... I populate textboxes on a userform with the following code Private Sub cmdEditChemical_Click() Dim Chemical As Variant Chemical = Sheets("Chemicals").Cells.Find(What:=lstChemicalDa tabase.Text, LookIn:=xlFormulas, _ LookAt:=1, SearchDirection:=xlNext, MatchCase:=False).Offset(0, 0).Address With Sheets("Chemicals").Range(Chemical) TextBoxName.Text = .Offset(0, 0) TextBoxCAS.Text = .Offset(0, 1) TextBoxMW.Text = .Offset(0, 2) TextBoxDensity.Text = .Offset(0, 3) TextBoxConc.Value = .Offset(0, 4) TextBoxMaterial.Text = .Offset(0, 5) TextBoxSupplier.Value = .Offset(0, 6) TextBoxPack.Value = .Offset(0, 7) TextBoxUnit.Value = .Offset(0, 8) TextBoxWasteClass.Value = .Offset(0, 9) TextBoxCost.Value = .Offset(0, 10) End With End Sub I need the textboxes to show particular formatting for example : TextBoxCost needs to be $0.00 format or TextBoxConc needs to be XX.X% format Can anyone help with the syntax of the code to help me with the formats? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Axes values changes autmatically / textboxes lose formatting | Charts and Charting in Excel | |||
Show Results in TextBoxes, ONLY if All TextBoxes have Data in them | Excel Programming | |||
formatting all textboxes in a userform | Excel Programming | |||
Problem with Formatting Textboxes | Excel Programming | |||
textboxes | Excel Programming |