Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 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
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
Format a Double to have one decimal place number? Ed Excel Programming 3 June 27th 07 03:01 PM
Format Numbers Without Fixed Decimal bgray1796 New Users to Excel 5 March 20th 07 05:17 PM
Converting 2-place decimal value to floating point decimal number with leading zero Kermit Piper Excel Discussion (Misc queries) 3 March 18th 06 06:20 PM
Fixed decimal place CheriFireFox Setting up and Configuration of Excel 2 May 13th 05 04:10 PM
How do I override fixed decimal place settings in EXcel 2003? jroyv Excel Worksheet Functions 2 February 11th 05 06:07 PM


All times are GMT +1. The time now is 09:36 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"