ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   change format (https://www.excelbanter.com/excel-programming/427489-change-format.html)

Woodi2

change format
 
What code do i need to cahnge the value in the code below to 2 decimal places
and starting with a £ sign

Sheets("RENTAL COSTS").Select
Me.TextBox1.Value = Range("B9").Value

Dave Peterson

change format
 
If the value in B9 is already formatted nicely:
Me.TextBox1.Value = Activesheet.Range("B9").Text

If it isn't formatted nicely, then something like:
Me.TextBox1.Value = format(Activesheet.Range("B9").Value,"£#,##0.00")



Woodi2 wrote:

What code do i need to cahnge the value in the code below to 2 decimal places
and starting with a £ sign

Sheets("RENTAL COSTS").Select
Me.TextBox1.Value = Range("B9").Value


--

Dave Peterson

JLGWhiz[_2_]

change format
 
Try this.

Me.TextBox1.Value = Format(Range("B9").Value, Chr(163) & "###,##0.00")



"Woodi2" wrote in message
...
What code do i need to cahnge the value in the code below to 2 decimal
places
and starting with a £ sign

Sheets("RENTAL COSTS").Select
Me.TextBox1.Value = Range("B9").Value




Woodi2

change format
 
Thanks Dave. It is formatted nicely, knew it had tobe simple.


"Dave Peterson" wrote:

If the value in B9 is already formatted nicely:
Me.TextBox1.Value = Activesheet.Range("B9").Text

If it isn't formatted nicely, then something like:
Me.TextBox1.Value = format(Activesheet.Range("B9").Value,"£#,##0.00")



Woodi2 wrote:

What code do i need to cahnge the value in the code below to 2 decimal places
and starting with a £ sign

Sheets("RENTAL COSTS").Select
Me.TextBox1.Value = Range("B9").Value


--

Dave Peterson


Rick Rothstein

change format
 
You can enter the £ character directly into the format string and save the
Chr function call. To do this, press Alt+0163 from the **number pad** (not
the main keyboard).

Me.TextBox1.Value = Format(Range("B9").Value, "£###,##0.00")
--
Rick (MVP - Excel)


"JLGWhiz" wrote in message
...
Try this.

Me.TextBox1.Value = Format(Range("B9").Value, Chr(163) & "###,##0.00")



"Woodi2" wrote in message
...
What code do i need to cahnge the value in the code below to 2 decimal
places
and starting with a £ sign

Sheets("RENTAL COSTS").Select
Me.TextBox1.Value = Range("B9").Value






All times are GMT +1. The time now is 02:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com