Solved

exporting a money field to excel

Posted on 2016-09-15
3
32 Views
Last Modified: 2016-09-20
Hello,
I am exporting datagridview to excel .
The money field which has values like :
61,999.65  from datagridview gets exported as 61999.65
how to get comma , exported?


 xlRange = xlWorkSheet.Range("H1")
                    xlRange.EntireColumn.NumberFormat = "#,##0.00"
0
Comment
Question by:RIAS
  • 2
3 Comments
 
LVL 20

Accepted Solution

by:
ElrondCT earned 500 total points
ID: 41802161
The NumberFormat you show should give the correct display (commas for thousands, two digits after the decimal) in Excel. I'd do it as

 xlWorkSheet.Range("H:H").NumberFormat = "#,##0.00"
0
 

Author Comment

by:RIAS
ID: 41802194
Thanks will try and get back
0
 

Author Closing Comment

by:RIAS
ID: 41806042
Thanks mate!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now