Downloading data that has character |

texasguy66

New Member
Joined
May 31, 2023
Messages
16
Office Version
  1. 365
Platform
  1. Windows
Hello, I am downloading data from SAP using a macro in a .txt format. The issue I am having is that when the macro opens the .txt file and saving in an excel format, it splits any cell with | into two separate cells. This does not happen too often, but when it does it causes issues. Also I tried adding the code to change "|" to "" but it did not work.

Has anyone had this happen to them, and how were you able to correct the issue? Thanks.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Can you post your code showing how it opens the text file and how gets the data into the worksheet cells?



How to post your code using code tags:

 
Upvote 0
You can open a TXT file in Excel and specify how it parses the data. Ctrl-O, then in the filename enter *.txt and press enter, choose the file. Choose delimited in the wizard. On the next screen choose which delimiter to use. If you record that, you can paste it into your current code


1714155718599.png

1714155744166.png
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,287
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top