在 Excel 公式中插入换行符 (MacOS)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1672046/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Insert a Newline in Excel Formula (MacOS)
提问by Xofo
I am using MS Excel on a Mac.
我在 Mac 上使用 MS Excel。
I have a formula, and I wish to insert a newline into it:
我有一个公式,我想在其中插入一个换行符:
Guests!A1 & " " & Guests!B1 & [newline here] Guests!C1
How can I do this?
我怎样才能做到这一点?
回答by richardtallent
CHAR() is the appropriate function for an Excel formula, and you need character 10 (Line Feed) to create a line break. Example:
CHAR() 是 Excel 公式的合适函数,您需要字符 10(换行)来创建换行符。例子:
Guests!A1 & " " & Guests!B1 & CHAR(10) & Guests!C1
You'll need to have word-wrapping enabled on the cell, otherwise CHAR(10) will just look like a little square.
您需要在单元格上启用自动换行,否则 CHAR(10) 看起来就像一个小方块。
vbCRLF would be the right choice when using VBA (i.e., a macro). The question is about formulas, not VBA.
当使用 VBA(即宏)时,vbCRLF 将是正确的选择。问题是关于公式,而不是 VBA。
回答by Nguyen Minh Binh
Press Command+ Option+ Enter
按Command+ Option+Enter
回答by Patrick Honorez
=Guests!A1 & " " & Guests!B1 & "<press Alt+Enter>
" & Guests!C1
Replace <press Alt+Enter>
by the actual key combination.
On a Mac, as Coxymla suggested, you will maybe replace Alt with another key ?
替换<press Alt+Enter>
为实际的组合键。
在 Mac 上,正如 Coxymla 建议的那样,您可能会用另一个键替换 Alt ?