Question posted 2011 · +5 upvotes
The below VBA in MS Access is run to format my Excel sheet. However, it is formatting to Number with 2 decimal places. How do I specify that I want 0 decimal places?
wb.Sheets(1).Range("K:AD").Formula = wb.Sheets(1).Range("K:AD").Value
wb.Sheets(1).Range("K:AD").NumberFormat = "Number"
Accepted answer +11 upvotes
wb.Sheets(1).Range("K:AD").NumberFormat = "0"
Top excel-vba Q&A (6)
- How to clear the entire array? +58 (2010)
- How to change Format of a Cell to Text using VBA +55 (2011)
- Download attachment from Outlook and Open in Excel +43 (2012)
- Can a VBA function in Excel return a range? +36 (2009)
- 2 Dimensional array from range +34 (2013)
- Hiding an Excel worksheet with VBA +33 (2009)
excel-vba solutions on this site
.