Leading zeros dropped in Excel

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ineedahelp
    New Member
    • Sep 2006
    • 98

    Leading zeros dropped in Excel

    Can anyone help me...I am trying to output my access report to excel. One of my fields is formatted as text, but excel is dropping leading zeros...only on the records where all values are numeric. The alphanumberic records keep the leading zeros. If someone could supply the vba it would be much appreciated.
    Thank you for any help!
  • kiask2343
    New Member
    • Sep 2006
    • 10

    #2
    Double check that the field is set to text, becuase that is the only thing I can think of that would cuase that.

    Comment

    • MMcCarthy
      Recognized Expert MVP
      • Aug 2006
      • 14387

      #3
      Excel will try to change a field to numeric when there are only numbers present. Are you using the TransferSpreads heet command and is the excel spreadsheet already existing. One option is to try putting an apostrophe before all the numbers. Excel will know to read it as text.

      Originally posted by ineedahelp
      Can anyone help me...I am trying to output my access report to excel. One of my fields is formatted as text, but excel is dropping leading zeros...only on the records where all values are numeric. The alphanumberic records keep the leading zeros. If someone could supply the vba it would be much appreciated.
      Thank you for any help!

      Comment

      • lohithb
        New Member
        • Jun 2006
        • 2

        #4
        Just put an   before all strings, it will work fine

        Comment

        Working...