Results 1 to 3 of 3
  1. #1
    mkc80 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    56

    Number Format to General Format

    I am exporting data from access 2007 to Excel 2007 using VBA code. I have a whole number, which I want displayed as whole number. But after the export, the number is using the 1000's seperator in Excel. So for example if my original number in access table is 12000, it is showing up as 12,000 in the excel file.



    It has something to do with the NumberFormat property. I have tried doing this but doesn't work.
    objSheet.Range("A1:A7").NumberFormat = "General"

    Can someone suggest the correct way of handling this?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,920
    What do you mean 'doesn't work' - error message, nothing happens, wrong results?

    I tested code in VBA behind Excel and it works so must be something about execution in Access. Post complete procedure code or provide files for analysis.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    bcmarshall is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jul 2010
    Posts
    95
    You should be able to convert easily enough. Try this. Str([YourNumberField]). It will essentially be text at that point, like an address would be 12345 Mockingbird Lane, not 12,345 Mockingbird Lane. Also, check the cell formatting in Excel. Should be General.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Number Field Format.
    By cap.zadi in forum Reports
    Replies: 2
    Last Post: 12-04-2011, 10:17 PM
  2. Number format in queries
    By bullwinkle55423 in forum Queries
    Replies: 1
    Last Post: 08-16-2011, 06:55 PM
  3. Conditional number format
    By terryvanduzee in forum Forms
    Replies: 1
    Last Post: 07-14-2011, 01:29 AM
  4. Default number format?
    By joewilly1 in forum Queries
    Replies: 1
    Last Post: 11-24-2010, 09:57 AM
  5. Phone number format
    By ManvinderKaur in forum Access
    Replies: 1
    Last Post: 06-24-2010, 08:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums