Article ID: 198498
Article Last Modified on 6/24/2004
APPLIES TO
- Microsoft Access 2000 Standard Edition
This article was previously published under Q198498
Moderate: Requires basic macro, coding, and interoperability skills.
SYMPTOMS
If you export a Microsoft Access table that contains line separators to
Microsoft Excel format, the line separators will not appear as expected in
Microsoft Excel. Instead, you see two vertical characters where the line
separators should be.
RESOLUTION
To avoid this behavior, when you export from Microsoft Access, in the
Export dialog box, click the
Save Formatted option, and then click
Save.
However, if you are unable to re-export the data from Microsoft Access, you
can eliminate the vertical bar characters from the Microsoft Excel
spreadsheet as follows:
- Open the Microsoft Excel spreadsheet that contains the imported table with the vertical bars.
- On the Tools menu, point to Macro, and then click Visual Basic Editor.
- In the Visual Basic Editor, on the Insert Menu, click Module.
- In the new module, type the following:
Sub changeStr()
EndCell = Range("A1").SpecialCells(xlCellTypeLastCell).Address
ActiveSheet.Range("A1:" & EndCell).Replace _
What:=Chr(13) & Chr(10), Replacement:=Chr(10), _
SearchOrder:=xlByColumns, MatchCase:=True
End Sub
- Close the Visual Basic Editor.
- On the Tools menu, point to Macro, and then click Macros.
- In the Macros list, select changeStr, and then click Run.
Note that the vertical bars are gone, and the line breaks are where they
should be.
STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
Additional query words: pra
Keywords: kbbug kbnofix KB198498