Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Format number to fixed decimal place
Hi
I have modified Ron de Bruin's SendMail code example to send an email when a certain procedure is complete, and all works fine. However, as part of the message body I want the value from a cell (TotalD) on the worksheet to be included. This also works fine but if the value has a trailing zero, it shows as 123456.8 in the body text of the email instead of 123456.80 which is how I want it. I'm having trouble getting the code to format the number correctly - can anyone point me in the right direction as I'm sure it's something simple. The portion of code is below: Dim OutApp As Object Dim OutMail As Object Dim TotalD As Double TotalD = Range("H3") Application.ScreenUpdating = False Set OutApp = CreateObject("Outlook.Application") OutApp.Session.Logon On Error GoTo cleanup Set OutMail = OutApp.CreateItem(0) On Error Resume Next With OutMail .To = " .Subject = "URGENT: Direct Debit File Awaiting Submission" .Body = "A new Direct Debit submission file has been created and is awaiting pickup and transmission in Bottomline PayBase. The total value for the submission is: £" & TotalD .Send End With Thanks very much Martyn Excel 2000, Windows 2003 server over Citrix PS4 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Format a Double to have one decimal place number? | Excel Programming | |||
Format Numbers Without Fixed Decimal | New Users to Excel | |||
Converting 2-place decimal value to floating point decimal number with leading zero | Excel Discussion (Misc queries) | |||
Fixed decimal place | Setting up and Configuration of Excel | |||
How do I override fixed decimal place settings in EXcel 2003? | Excel Worksheet Functions |