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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default 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




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
Lock Cell Format - Allow copy and paste of data without format change Chris12InKC Excel Worksheet Functions 2 May 9th 23 07:42 PM
Change Date Format to Specific Text Format When Copying [email protected] Excel Discussion (Misc queries) 4 December 23rd 08 03:43 PM
Change cell colour on formula result change, no conditional format roster_jon Excel Programming 0 December 2nd 08 12:11 PM
Use date modified to change format & create filter to track change PAR Excel Worksheet Functions 0 November 15th 06 09:17 PM
excel numbers in general format i cant add cant change format claude Excel Worksheet Functions 2 July 7th 06 08:18 PM


All times are GMT +1. The time now is 08:50 AM.

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"