ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   thousands comma separator in VBA (https://www.excelbanter.com/excel-discussion-misc-queries/51859-thousands-comma-separator-vba.html)

Wendy Francis

thousands comma separator in VBA
 
Hi
I have variables defined in an Excel macro as Long, and I want them to
return the value in a Word Report with thousand comma separators - is there
a way of doing this please?
Wendy Francis




ShaunM

thousands comma separator in VBA
 

Hi Wendy

You can use FormatNumber() to format your variable before you produce
your report.

eg. YourVariable = FormatNumber(YourNum, , , , vbTrue)

Regards
Shaun


--
ShaunM
------------------------------------------------------------------------
ShaunM's Profile: http://www.excelforum.com/member.php...o&userid=18610
View this thread: http://www.excelforum.com/showthread...hreadid=478646


Wendy Francis

thousands comma separator in VBA
 
That's brilliant Shaun. Thanks very much.

Wendy




All times are GMT +1. The time now is 06:32 AM.

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