Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 249
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Axes values changes autmatically / textboxes lose formatting Anand Nichkaode Charts and Charting in Excel 5 March 28th 08 04:30 PM
Show Results in TextBoxes, ONLY if All TextBoxes have Data in them RyanH Excel Programming 3 November 19th 07 03:30 PM
formatting all textboxes in a userform umich1967 Excel Programming 8 September 11th 06 09:10 PM
Problem with Formatting Textboxes Henryhbb Excel Programming 1 June 6th 05 05:06 PM
textboxes libby Excel Programming 5 April 13th 04 06:32 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"