Microsoft-excel newlines and tab
Current I use "CONCATENATE" to join string in Excel, but I want insert character newlines and tab in string joined by "CONCATENATE".
Example:
I've string below when I completed join string.
"Today is very beautiful"
I expected string newlines and tab auto as below:
Today is
verry
beautiful
How to do that?
microsoft-excel microsoft-office microsoft-excel-2007 worksheet-function
add a comment |
Current I use "CONCATENATE" to join string in Excel, but I want insert character newlines and tab in string joined by "CONCATENATE".
Example:
I've string below when I completed join string.
"Today is very beautiful"
I expected string newlines and tab auto as below:
Today is
verry
beautiful
How to do that?
microsoft-excel microsoft-office microsoft-excel-2007 worksheet-function
1
Not a solution for Excel users, but it might help someone: The spreadsheet program "Gnumeric" accepts tabs.
– Nicolas Raoul
Sep 2 '16 at 7:54
add a comment |
Current I use "CONCATENATE" to join string in Excel, but I want insert character newlines and tab in string joined by "CONCATENATE".
Example:
I've string below when I completed join string.
"Today is very beautiful"
I expected string newlines and tab auto as below:
Today is
verry
beautiful
How to do that?
microsoft-excel microsoft-office microsoft-excel-2007 worksheet-function
Current I use "CONCATENATE" to join string in Excel, but I want insert character newlines and tab in string joined by "CONCATENATE".
Example:
I've string below when I completed join string.
"Today is very beautiful"
I expected string newlines and tab auto as below:
Today is
verry
beautiful
How to do that?
microsoft-excel microsoft-office microsoft-excel-2007 worksheet-function
microsoft-excel microsoft-office microsoft-excel-2007 worksheet-function
edited Mar 19 '12 at 5:05
Boy's Rules
asked Mar 19 '12 at 4:26
Boy's RulesBoy's Rules
61114
61114
1
Not a solution for Excel users, but it might help someone: The spreadsheet program "Gnumeric" accepts tabs.
– Nicolas Raoul
Sep 2 '16 at 7:54
add a comment |
1
Not a solution for Excel users, but it might help someone: The spreadsheet program "Gnumeric" accepts tabs.
– Nicolas Raoul
Sep 2 '16 at 7:54
1
1
Not a solution for Excel users, but it might help someone: The spreadsheet program "Gnumeric" accepts tabs.
– Nicolas Raoul
Sep 2 '16 at 7:54
Not a solution for Excel users, but it might help someone: The spreadsheet program "Gnumeric" accepts tabs.
– Nicolas Raoul
Sep 2 '16 at 7:54
add a comment |
7 Answers
7
active
oldest
votes
As TAB cannot be displayed in Excel cell, instead of using CHAR(9)
, in order to indent the line, I recommend using spaces. By using REPT()
function, it will be easier to control the indent width by specifying the number of spaces (e.g. 4).
=CONCATENATE(A1, CHAR(10), REPT(" ", 4), A2)
Alternatively, I usually use &
for concatenation to simplify the formula.
=A1 & CHAR(10) & REPT(" ", 4) & A2
Lastly, you have to format the cell as "Wrap text" by CTRL-1
> Alignment
add a comment |
You can try this formula:-
=CONCATENATE(A1,CHAR(10),CHAR(9),B1,CHAR(10),CHAR(9),C1)
Here
CHAR(10) - Line Feed/New Line
CHAR(9) - Horizontal Tab
To see new line, you need to mark as checked on the Wrap Text
box
Right click on Cell --> Format Cells --> Click on Alignment Tab --> Under Text control --> Check the box "Wrap Text"
Note: Tab spacing won't appear on the Cell
Here's a link to the Excel help for theCHAR
function. Here's the table of values that you can use on Windows and on Mac via Wikipedia. It is important to note that the results may be different on each OS.
– Elliott
Jun 11 '17 at 17:23
add a comment |
You could try adding newline and tabs yourself, as just another text element:
=CONCATENATE("Today is", Chr(13), Chr(9), "verry", Chr(13), Chr(9), "beautiful"
whereas Chr(13)
produces a newline and Chr(9)
a tab.
Sorry Boy's Rules, Char(13) is a carriage return, not new line. My bad
– boretom
Mar 28 '12 at 19:10
add a comment |
This post is old, but I wasn't able to find any satisfying answer to this question anywhere on Google, hence here's what I've come up with:
=CONCAT("Today is";CHAR(10);REPT(CHAR(1);2);"very";CHAR(10);REPT(CHAR(1);2);"beautiful")
will display as:
...which is more or less like this:
Today is
very
beautiful
CHAR(1) is the unprintable "Start of Heading" character in the ASCII system
Microsoft Office 365 ProPlus
New contributor
add a comment |
You can also use "&" chars to concatenate text in Excel, as below:
The clause: =CONCATENATE(A1,CHAR(10),CHAR(9),B1,CHAR(10),CHAR(9),C1)
could be written as:
=A1&CHAR(10)&CHAR(9)&B1&CHAR(10)&CHAR(9)&C1
This form will be interesting when CONCATENATE overflows (it has a limit of entries).
add a comment |
There seems to be no way to make
="some string"&char(9)&"another string"
work. The resulting text pasted as plain text in a txt file or a as unformated text in word is as follows:
"some string another string"
Including the unwanted double quotes.
If pasted as keep or merged formatting it is as follows:
some string another string
Please note that the tab has been replaced with a single space.
If instead of char(9) a printable character such as “!” char(33) the resulting text pasted in word or a text editor is always:
some string!another string
The bottom line is:
Currently there appears to be no method to insert a tab in a cell. This is a pity as there is a genuine need for this. A workaround is to insert a character that isn’t expected in the cell and then use a post processer or a macro in the target editor. I intend to use a grave (just above the tab) and a word VBA macro to convert it to a tab.
add a comment |
Simple: Paste them from text editor as quoted plain text (TSV format).
No one mentioned this simple and obvious method so far.
Create the cell content in Notepad with actual
tab
andnewline
characters. This example contains them all (here Tab is illustrated as↹
):
Before Tab↹AfterTab
Second "line" of the same cell.
Surround the entire content with double quotes
"
(A conversion into TSV format).
Should be there any double quotes already inside the original text, double them. For better clarity I put them into the above example.
The above example will now look like:
"Before Tab↹AfterTab
Second ""line"" of the same cell."
Mark the entire text (Ctrl+A) and press Ctrl+C copy it into clipboard.
- In Excel, navigate to the cell (but do not enter its edit mode) and press Ctrl+V to paste.
Done. Now the cell content is exactly as you expect it, including newlines and tabs. (You can verify it by formulas, VBA or by round trip, i.e. by copy-paste back to text file). Mandatory notices:
You might need to increase row height to reveal the second line.
Do not expect correct formatting of contained Tab characters. (But you know that already.) Excel is not designed to handle them properly inside the cell. Should you need left indentation of cell content, open Format Cells window (Ctrl+1) and set the Indent value on Alignment tab.
Tip: You can insert multiple cells by using newline and tab outside the quotes.
This example (two rows by two columns in TSV) will insert area of 2×2 cells at once:
A1↹B1
A2↹B2
If you see its point, you can add newlines and tabs inside the values:
"A↹1
cell"↹"B↹1
cell"
"A↹2
cell"↹"B↹2
cell"
Tested with Excel 2016.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f402277%2fmicrosoft-excel-newlines-and-tab%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
7 Answers
7
active
oldest
votes
7 Answers
7
active
oldest
votes
active
oldest
votes
active
oldest
votes
As TAB cannot be displayed in Excel cell, instead of using CHAR(9)
, in order to indent the line, I recommend using spaces. By using REPT()
function, it will be easier to control the indent width by specifying the number of spaces (e.g. 4).
=CONCATENATE(A1, CHAR(10), REPT(" ", 4), A2)
Alternatively, I usually use &
for concatenation to simplify the formula.
=A1 & CHAR(10) & REPT(" ", 4) & A2
Lastly, you have to format the cell as "Wrap text" by CTRL-1
> Alignment
add a comment |
As TAB cannot be displayed in Excel cell, instead of using CHAR(9)
, in order to indent the line, I recommend using spaces. By using REPT()
function, it will be easier to control the indent width by specifying the number of spaces (e.g. 4).
=CONCATENATE(A1, CHAR(10), REPT(" ", 4), A2)
Alternatively, I usually use &
for concatenation to simplify the formula.
=A1 & CHAR(10) & REPT(" ", 4) & A2
Lastly, you have to format the cell as "Wrap text" by CTRL-1
> Alignment
add a comment |
As TAB cannot be displayed in Excel cell, instead of using CHAR(9)
, in order to indent the line, I recommend using spaces. By using REPT()
function, it will be easier to control the indent width by specifying the number of spaces (e.g. 4).
=CONCATENATE(A1, CHAR(10), REPT(" ", 4), A2)
Alternatively, I usually use &
for concatenation to simplify the formula.
=A1 & CHAR(10) & REPT(" ", 4) & A2
Lastly, you have to format the cell as "Wrap text" by CTRL-1
> Alignment
As TAB cannot be displayed in Excel cell, instead of using CHAR(9)
, in order to indent the line, I recommend using spaces. By using REPT()
function, it will be easier to control the indent width by specifying the number of spaces (e.g. 4).
=CONCATENATE(A1, CHAR(10), REPT(" ", 4), A2)
Alternatively, I usually use &
for concatenation to simplify the formula.
=A1 & CHAR(10) & REPT(" ", 4) & A2
Lastly, you have to format the cell as "Wrap text" by CTRL-1
> Alignment
answered Mar 19 '12 at 9:38
wilsonwilson
3,61311536
3,61311536
add a comment |
add a comment |
You can try this formula:-
=CONCATENATE(A1,CHAR(10),CHAR(9),B1,CHAR(10),CHAR(9),C1)
Here
CHAR(10) - Line Feed/New Line
CHAR(9) - Horizontal Tab
To see new line, you need to mark as checked on the Wrap Text
box
Right click on Cell --> Format Cells --> Click on Alignment Tab --> Under Text control --> Check the box "Wrap Text"
Note: Tab spacing won't appear on the Cell
Here's a link to the Excel help for theCHAR
function. Here's the table of values that you can use on Windows and on Mac via Wikipedia. It is important to note that the results may be different on each OS.
– Elliott
Jun 11 '17 at 17:23
add a comment |
You can try this formula:-
=CONCATENATE(A1,CHAR(10),CHAR(9),B1,CHAR(10),CHAR(9),C1)
Here
CHAR(10) - Line Feed/New Line
CHAR(9) - Horizontal Tab
To see new line, you need to mark as checked on the Wrap Text
box
Right click on Cell --> Format Cells --> Click on Alignment Tab --> Under Text control --> Check the box "Wrap Text"
Note: Tab spacing won't appear on the Cell
Here's a link to the Excel help for theCHAR
function. Here's the table of values that you can use on Windows and on Mac via Wikipedia. It is important to note that the results may be different on each OS.
– Elliott
Jun 11 '17 at 17:23
add a comment |
You can try this formula:-
=CONCATENATE(A1,CHAR(10),CHAR(9),B1,CHAR(10),CHAR(9),C1)
Here
CHAR(10) - Line Feed/New Line
CHAR(9) - Horizontal Tab
To see new line, you need to mark as checked on the Wrap Text
box
Right click on Cell --> Format Cells --> Click on Alignment Tab --> Under Text control --> Check the box "Wrap Text"
Note: Tab spacing won't appear on the Cell
You can try this formula:-
=CONCATENATE(A1,CHAR(10),CHAR(9),B1,CHAR(10),CHAR(9),C1)
Here
CHAR(10) - Line Feed/New Line
CHAR(9) - Horizontal Tab
To see new line, you need to mark as checked on the Wrap Text
box
Right click on Cell --> Format Cells --> Click on Alignment Tab --> Under Text control --> Check the box "Wrap Text"
Note: Tab spacing won't appear on the Cell
answered Mar 19 '12 at 9:30
Siva CharanSiva Charan
3,66321728
3,66321728
Here's a link to the Excel help for theCHAR
function. Here's the table of values that you can use on Windows and on Mac via Wikipedia. It is important to note that the results may be different on each OS.
– Elliott
Jun 11 '17 at 17:23
add a comment |
Here's a link to the Excel help for theCHAR
function. Here's the table of values that you can use on Windows and on Mac via Wikipedia. It is important to note that the results may be different on each OS.
– Elliott
Jun 11 '17 at 17:23
Here's a link to the Excel help for the
CHAR
function. Here's the table of values that you can use on Windows and on Mac via Wikipedia. It is important to note that the results may be different on each OS.– Elliott
Jun 11 '17 at 17:23
Here's a link to the Excel help for the
CHAR
function. Here's the table of values that you can use on Windows and on Mac via Wikipedia. It is important to note that the results may be different on each OS.– Elliott
Jun 11 '17 at 17:23
add a comment |
You could try adding newline and tabs yourself, as just another text element:
=CONCATENATE("Today is", Chr(13), Chr(9), "verry", Chr(13), Chr(9), "beautiful"
whereas Chr(13)
produces a newline and Chr(9)
a tab.
Sorry Boy's Rules, Char(13) is a carriage return, not new line. My bad
– boretom
Mar 28 '12 at 19:10
add a comment |
You could try adding newline and tabs yourself, as just another text element:
=CONCATENATE("Today is", Chr(13), Chr(9), "verry", Chr(13), Chr(9), "beautiful"
whereas Chr(13)
produces a newline and Chr(9)
a tab.
Sorry Boy's Rules, Char(13) is a carriage return, not new line. My bad
– boretom
Mar 28 '12 at 19:10
add a comment |
You could try adding newline and tabs yourself, as just another text element:
=CONCATENATE("Today is", Chr(13), Chr(9), "verry", Chr(13), Chr(9), "beautiful"
whereas Chr(13)
produces a newline and Chr(9)
a tab.
You could try adding newline and tabs yourself, as just another text element:
=CONCATENATE("Today is", Chr(13), Chr(9), "verry", Chr(13), Chr(9), "beautiful"
whereas Chr(13)
produces a newline and Chr(9)
a tab.
answered Mar 19 '12 at 6:29
boretomboretom
33626
33626
Sorry Boy's Rules, Char(13) is a carriage return, not new line. My bad
– boretom
Mar 28 '12 at 19:10
add a comment |
Sorry Boy's Rules, Char(13) is a carriage return, not new line. My bad
– boretom
Mar 28 '12 at 19:10
Sorry Boy's Rules, Char(13) is a carriage return, not new line. My bad
– boretom
Mar 28 '12 at 19:10
Sorry Boy's Rules, Char(13) is a carriage return, not new line. My bad
– boretom
Mar 28 '12 at 19:10
add a comment |
This post is old, but I wasn't able to find any satisfying answer to this question anywhere on Google, hence here's what I've come up with:
=CONCAT("Today is";CHAR(10);REPT(CHAR(1);2);"very";CHAR(10);REPT(CHAR(1);2);"beautiful")
will display as:
...which is more or less like this:
Today is
very
beautiful
CHAR(1) is the unprintable "Start of Heading" character in the ASCII system
Microsoft Office 365 ProPlus
New contributor
add a comment |
This post is old, but I wasn't able to find any satisfying answer to this question anywhere on Google, hence here's what I've come up with:
=CONCAT("Today is";CHAR(10);REPT(CHAR(1);2);"very";CHAR(10);REPT(CHAR(1);2);"beautiful")
will display as:
...which is more or less like this:
Today is
very
beautiful
CHAR(1) is the unprintable "Start of Heading" character in the ASCII system
Microsoft Office 365 ProPlus
New contributor
add a comment |
This post is old, but I wasn't able to find any satisfying answer to this question anywhere on Google, hence here's what I've come up with:
=CONCAT("Today is";CHAR(10);REPT(CHAR(1);2);"very";CHAR(10);REPT(CHAR(1);2);"beautiful")
will display as:
...which is more or less like this:
Today is
very
beautiful
CHAR(1) is the unprintable "Start of Heading" character in the ASCII system
Microsoft Office 365 ProPlus
New contributor
This post is old, but I wasn't able to find any satisfying answer to this question anywhere on Google, hence here's what I've come up with:
=CONCAT("Today is";CHAR(10);REPT(CHAR(1);2);"very";CHAR(10);REPT(CHAR(1);2);"beautiful")
will display as:
...which is more or less like this:
Today is
very
beautiful
CHAR(1) is the unprintable "Start of Heading" character in the ASCII system
Microsoft Office 365 ProPlus
New contributor
edited 2 days ago
Albin
2,3111129
2,3111129
New contributor
answered Jan 5 at 12:11
PickNickPickNick
112
112
New contributor
New contributor
add a comment |
add a comment |
You can also use "&" chars to concatenate text in Excel, as below:
The clause: =CONCATENATE(A1,CHAR(10),CHAR(9),B1,CHAR(10),CHAR(9),C1)
could be written as:
=A1&CHAR(10)&CHAR(9)&B1&CHAR(10)&CHAR(9)&C1
This form will be interesting when CONCATENATE overflows (it has a limit of entries).
add a comment |
You can also use "&" chars to concatenate text in Excel, as below:
The clause: =CONCATENATE(A1,CHAR(10),CHAR(9),B1,CHAR(10),CHAR(9),C1)
could be written as:
=A1&CHAR(10)&CHAR(9)&B1&CHAR(10)&CHAR(9)&C1
This form will be interesting when CONCATENATE overflows (it has a limit of entries).
add a comment |
You can also use "&" chars to concatenate text in Excel, as below:
The clause: =CONCATENATE(A1,CHAR(10),CHAR(9),B1,CHAR(10),CHAR(9),C1)
could be written as:
=A1&CHAR(10)&CHAR(9)&B1&CHAR(10)&CHAR(9)&C1
This form will be interesting when CONCATENATE overflows (it has a limit of entries).
You can also use "&" chars to concatenate text in Excel, as below:
The clause: =CONCATENATE(A1,CHAR(10),CHAR(9),B1,CHAR(10),CHAR(9),C1)
could be written as:
=A1&CHAR(10)&CHAR(9)&B1&CHAR(10)&CHAR(9)&C1
This form will be interesting when CONCATENATE overflows (it has a limit of entries).
edited Jan 22 '16 at 13:30
bummi
1,51931421
1,51931421
answered Jan 22 '16 at 12:38
MarcMirMarcMir
1
1
add a comment |
add a comment |
There seems to be no way to make
="some string"&char(9)&"another string"
work. The resulting text pasted as plain text in a txt file or a as unformated text in word is as follows:
"some string another string"
Including the unwanted double quotes.
If pasted as keep or merged formatting it is as follows:
some string another string
Please note that the tab has been replaced with a single space.
If instead of char(9) a printable character such as “!” char(33) the resulting text pasted in word or a text editor is always:
some string!another string
The bottom line is:
Currently there appears to be no method to insert a tab in a cell. This is a pity as there is a genuine need for this. A workaround is to insert a character that isn’t expected in the cell and then use a post processer or a macro in the target editor. I intend to use a grave (just above the tab) and a word VBA macro to convert it to a tab.
add a comment |
There seems to be no way to make
="some string"&char(9)&"another string"
work. The resulting text pasted as plain text in a txt file or a as unformated text in word is as follows:
"some string another string"
Including the unwanted double quotes.
If pasted as keep or merged formatting it is as follows:
some string another string
Please note that the tab has been replaced with a single space.
If instead of char(9) a printable character such as “!” char(33) the resulting text pasted in word or a text editor is always:
some string!another string
The bottom line is:
Currently there appears to be no method to insert a tab in a cell. This is a pity as there is a genuine need for this. A workaround is to insert a character that isn’t expected in the cell and then use a post processer or a macro in the target editor. I intend to use a grave (just above the tab) and a word VBA macro to convert it to a tab.
add a comment |
There seems to be no way to make
="some string"&char(9)&"another string"
work. The resulting text pasted as plain text in a txt file or a as unformated text in word is as follows:
"some string another string"
Including the unwanted double quotes.
If pasted as keep or merged formatting it is as follows:
some string another string
Please note that the tab has been replaced with a single space.
If instead of char(9) a printable character such as “!” char(33) the resulting text pasted in word or a text editor is always:
some string!another string
The bottom line is:
Currently there appears to be no method to insert a tab in a cell. This is a pity as there is a genuine need for this. A workaround is to insert a character that isn’t expected in the cell and then use a post processer or a macro in the target editor. I intend to use a grave (just above the tab) and a word VBA macro to convert it to a tab.
There seems to be no way to make
="some string"&char(9)&"another string"
work. The resulting text pasted as plain text in a txt file or a as unformated text in word is as follows:
"some string another string"
Including the unwanted double quotes.
If pasted as keep or merged formatting it is as follows:
some string another string
Please note that the tab has been replaced with a single space.
If instead of char(9) a printable character such as “!” char(33) the resulting text pasted in word or a text editor is always:
some string!another string
The bottom line is:
Currently there appears to be no method to insert a tab in a cell. This is a pity as there is a genuine need for this. A workaround is to insert a character that isn’t expected in the cell and then use a post processer or a macro in the target editor. I intend to use a grave (just above the tab) and a word VBA macro to convert it to a tab.
answered Aug 15 '17 at 0:45
Rb BolinRb Bolin
41
41
add a comment |
add a comment |
Simple: Paste them from text editor as quoted plain text (TSV format).
No one mentioned this simple and obvious method so far.
Create the cell content in Notepad with actual
tab
andnewline
characters. This example contains them all (here Tab is illustrated as↹
):
Before Tab↹AfterTab
Second "line" of the same cell.
Surround the entire content with double quotes
"
(A conversion into TSV format).
Should be there any double quotes already inside the original text, double them. For better clarity I put them into the above example.
The above example will now look like:
"Before Tab↹AfterTab
Second ""line"" of the same cell."
Mark the entire text (Ctrl+A) and press Ctrl+C copy it into clipboard.
- In Excel, navigate to the cell (but do not enter its edit mode) and press Ctrl+V to paste.
Done. Now the cell content is exactly as you expect it, including newlines and tabs. (You can verify it by formulas, VBA or by round trip, i.e. by copy-paste back to text file). Mandatory notices:
You might need to increase row height to reveal the second line.
Do not expect correct formatting of contained Tab characters. (But you know that already.) Excel is not designed to handle them properly inside the cell. Should you need left indentation of cell content, open Format Cells window (Ctrl+1) and set the Indent value on Alignment tab.
Tip: You can insert multiple cells by using newline and tab outside the quotes.
This example (two rows by two columns in TSV) will insert area of 2×2 cells at once:
A1↹B1
A2↹B2
If you see its point, you can add newlines and tabs inside the values:
"A↹1
cell"↹"B↹1
cell"
"A↹2
cell"↹"B↹2
cell"
Tested with Excel 2016.
add a comment |
Simple: Paste them from text editor as quoted plain text (TSV format).
No one mentioned this simple and obvious method so far.
Create the cell content in Notepad with actual
tab
andnewline
characters. This example contains them all (here Tab is illustrated as↹
):
Before Tab↹AfterTab
Second "line" of the same cell.
Surround the entire content with double quotes
"
(A conversion into TSV format).
Should be there any double quotes already inside the original text, double them. For better clarity I put them into the above example.
The above example will now look like:
"Before Tab↹AfterTab
Second ""line"" of the same cell."
Mark the entire text (Ctrl+A) and press Ctrl+C copy it into clipboard.
- In Excel, navigate to the cell (but do not enter its edit mode) and press Ctrl+V to paste.
Done. Now the cell content is exactly as you expect it, including newlines and tabs. (You can verify it by formulas, VBA or by round trip, i.e. by copy-paste back to text file). Mandatory notices:
You might need to increase row height to reveal the second line.
Do not expect correct formatting of contained Tab characters. (But you know that already.) Excel is not designed to handle them properly inside the cell. Should you need left indentation of cell content, open Format Cells window (Ctrl+1) and set the Indent value on Alignment tab.
Tip: You can insert multiple cells by using newline and tab outside the quotes.
This example (two rows by two columns in TSV) will insert area of 2×2 cells at once:
A1↹B1
A2↹B2
If you see its point, you can add newlines and tabs inside the values:
"A↹1
cell"↹"B↹1
cell"
"A↹2
cell"↹"B↹2
cell"
Tested with Excel 2016.
add a comment |
Simple: Paste them from text editor as quoted plain text (TSV format).
No one mentioned this simple and obvious method so far.
Create the cell content in Notepad with actual
tab
andnewline
characters. This example contains them all (here Tab is illustrated as↹
):
Before Tab↹AfterTab
Second "line" of the same cell.
Surround the entire content with double quotes
"
(A conversion into TSV format).
Should be there any double quotes already inside the original text, double them. For better clarity I put them into the above example.
The above example will now look like:
"Before Tab↹AfterTab
Second ""line"" of the same cell."
Mark the entire text (Ctrl+A) and press Ctrl+C copy it into clipboard.
- In Excel, navigate to the cell (but do not enter its edit mode) and press Ctrl+V to paste.
Done. Now the cell content is exactly as you expect it, including newlines and tabs. (You can verify it by formulas, VBA or by round trip, i.e. by copy-paste back to text file). Mandatory notices:
You might need to increase row height to reveal the second line.
Do not expect correct formatting of contained Tab characters. (But you know that already.) Excel is not designed to handle them properly inside the cell. Should you need left indentation of cell content, open Format Cells window (Ctrl+1) and set the Indent value on Alignment tab.
Tip: You can insert multiple cells by using newline and tab outside the quotes.
This example (two rows by two columns in TSV) will insert area of 2×2 cells at once:
A1↹B1
A2↹B2
If you see its point, you can add newlines and tabs inside the values:
"A↹1
cell"↹"B↹1
cell"
"A↹2
cell"↹"B↹2
cell"
Tested with Excel 2016.
Simple: Paste them from text editor as quoted plain text (TSV format).
No one mentioned this simple and obvious method so far.
Create the cell content in Notepad with actual
tab
andnewline
characters. This example contains them all (here Tab is illustrated as↹
):
Before Tab↹AfterTab
Second "line" of the same cell.
Surround the entire content with double quotes
"
(A conversion into TSV format).
Should be there any double quotes already inside the original text, double them. For better clarity I put them into the above example.
The above example will now look like:
"Before Tab↹AfterTab
Second ""line"" of the same cell."
Mark the entire text (Ctrl+A) and press Ctrl+C copy it into clipboard.
- In Excel, navigate to the cell (but do not enter its edit mode) and press Ctrl+V to paste.
Done. Now the cell content is exactly as you expect it, including newlines and tabs. (You can verify it by formulas, VBA or by round trip, i.e. by copy-paste back to text file). Mandatory notices:
You might need to increase row height to reveal the second line.
Do not expect correct formatting of contained Tab characters. (But you know that already.) Excel is not designed to handle them properly inside the cell. Should you need left indentation of cell content, open Format Cells window (Ctrl+1) and set the Indent value on Alignment tab.
Tip: You can insert multiple cells by using newline and tab outside the quotes.
This example (two rows by two columns in TSV) will insert area of 2×2 cells at once:
A1↹B1
A2↹B2
If you see its point, you can add newlines and tabs inside the values:
"A↹1
cell"↹"B↹1
cell"
"A↹2
cell"↹"B↹2
cell"
Tested with Excel 2016.
edited Oct 4 '17 at 11:35
answered Oct 4 '17 at 11:10
miroxlavmiroxlav
7,38342567
7,38342567
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f402277%2fmicrosoft-excel-newlines-and-tab%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Not a solution for Excel users, but it might help someone: The spreadsheet program "Gnumeric" accepts tabs.
– Nicolas Raoul
Sep 2 '16 at 7:54