Solved

exporting a money field to excel

Posted on 2016-09-15
3
40 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

726 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