Formatting returned values within a text string in VB

DonkeyOte

MrExcel MVP
Joined
Sep 6, 2002
Messages
9,124
I am sure someone has probably explained this before but I have never been able to do the following.

I am running a spreadsheet that analyses actual versus budget positions in real time, part of this solution are automatic warning flag emails that get sent to various departments as and when adverse variances above 10% of budget arise. This is all fine and is coded etc... the problem I have is that when there's an adverse variance the VB creates a text string for the email along thses lines:

Nominal Code - Description of Code - Amount of Variance - "overspend" - in Q# (variable)

The problem is the Amount of Variance as I can not work out how to ensure that this values is returned in the format of #,##0.00

Anyone know how I can amend the below code to have this effect:

Range("P" & CROW) = Range("A" & CROW) & " - " & Range("B" & CROW) & " - " & -NCODE & " Overspend in Q" & Range("N1")

where -NCODE is equivalent to the value.

Thanks
Luke

I help you now you help me?
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Forum statistics

Threads
1,214,960
Messages
6,122,479
Members
449,088
Latest member
Melvetica

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top