I'm writing a program that emails some data to a few of my employee's

One of them tracks the data in excel so I added a purely data line in text to the bottom of the email so he can just copy and paste it into excel.

I used \t (tabs) to denote fields but when I paste, it all runs together. Is there a character to put in each field in a cell in excel?


You can use anything you want that doesn't appear in your data. A popular choice is either "," or "|". When you paste in your data there should be a little box that appears in the lower right of what you just pasted, and you can use that to modify how the data was imported, otherwise you can just use Data-> Text to columns. Then select deliminator, then type in the deliminator you want to use.

  • not exactly what i wanted but tab's dont seem to work in the email im sending (it replaced with 5 spaces) so i went with | and this combined with the text to column that you showed me finished the project. – Crash893 Aug 27 '10 at 13:48

As long as you use the same character in between each word (even a space) and then using the text to columns option in excel, then excel will automatically take those texts and convert them to a column, or separate cell:

"This is a test" will convert each word to a cell.

"This:is:a:test" will also, but you have to tell excel that the symbol is the colon. alt text

  • it also works with numbers as well. – James Mertz Aug 26 '10 at 16:14

Are you creating your message in HTML? Tabs generally get replaced with spaces in HTML messages.

Try creating your e-mail in plain text format and the tabs should be retained and you'll get the expected behaviour when pasting into Excel.

  • thats what was happening, I replaced tab with | and it doesn't work as well as i wanted but its just 2 extra steps – Crash893 Aug 27 '10 at 13:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.