16 Replies Latest reply: Sep 18, 2012 1:30 PM by Gerhard Laubscher RSS

    macro to copy and paste long account # in excel

    Gerhard Laubscher



      I use a macro to create a report. Part of it is to copy possible values from a list box ("Account no") and paste it in Excel.


      The Account Numbers can be between 16 and 20 characters long.

      After running the macro it changes a number like 10201128030000086054 to this: 10201128030000000000.


      I have tried formatting after the paste, like this:

      XLApp.Worksheets(1).Range("A1:A500000").NumberFormat = "@"


      And I have tried the text() function when loading the field in QV - but no luck.


      Any ideas how I can get the full Account Number in excel, and not limit it to 15 characters + zeroes? It works when I click on the XL (export listbox) button, but due to the nature of my macro I have to copy and paste.