excel 替换 换行符_在Excel中查找和替换换行符

excel 替换 换行符

When you want to create a line break (line feed) in a cell, you press Alt + Enter, to start a new line. You can put one or more line breaks in a cell, to make the contents easier to read. But how can you find and replace line breaks in Excel?

如果要在单元格中创建换行符(换行),请按Alt + Enter,以开始新的换行。 您可以在一个单元格中放置一个或多个换行符,以使内容更易于阅读。 但是,如何在Excel中查找和替换换行符?

在Excel中查找换行符 (Find Line Breaks in Excel)

Line breaks are easy to add, but a little trickier to remove.

换行符很容易添加,但删除起来有点棘手。

To find specific text in Excel, you can use Ctrl + F to open the Find and Replace dialog box. However, if you try to type Alt + Enter in the Find What box, you’ll just hear a beep from your computer. Excel won’t let you put that shortcut into the Find What box.

要在Excel中查找特定文本,可以使用Ctrl + F打开“查找和替换”对话框。 但是,如果您尝试在“查找内容”框中键入Alt + Enter,则只会听到计算机发出蜂鸣声。 Excel不允许您将快捷方式放入“查找内容”框中。

Instead of using Alt + Enter, you can use a special shortcut to enter a line break in the Find What box: Ctrl + J 

代替使用Alt + Enter,可以使用特殊的快捷方式在“查找内容”框中输入换行符: Ctrl + J

Why does that work? A line break is character 10 in the ASCII character set, and the Ctrl + J shortcut is the ASCII control code for character 10.

为什么行得通? 换行符是ASCII字符集中的字符10,而Ctrl + J快捷键是字符10的ASCII控制代码

查找并替换换行符 (Find and Replace a Line Break)

To find a line break, and replace it with a space character, follow these steps. There is a video below, that shows the steps.

若要找到一个换行符,并将其替换为空格字符,请按照下列步骤操作。 下面有一个视频,显示了步骤。

  1. Select the cells that you want to search

    选择您要搜索的单元格
  2. On the keyboard, press Ctrl + H to open the Find and Replace dialog box, with the Replace tab active

    在键盘上,按Ctrl + H以打开“查找和替换”对话框,其中“替换”选项卡处于活动状态
  3. Click in the Find What box

    单击查找内容框
  4. On the keyboard, press Ctrl + J to enter the line break character -- NOTE: No text will appear in the Find What box -- just a small blinking dot

    在键盘上,按Ctrl + J键输入换行符-注意:“查找内容”框中将不会显示任何文本-只是一个小的闪烁点

  5. Press the Tab key on the keyboard, to move to the Replace With box

    按键盘上的Tab键,移至“替换为”框
  6. Type a space character

    输入空格
  7. Then, click Find Next or Find All, to find the cells with line breaks.

    然后,单击“查找下一个”或“查找所有”,以查找带有换行符的单元格。
  8. OR, click Replace or Replace All, to replace the line breaks with space characters.

    或者,单击“替换”或“全部替换”,以换行符替换为空格字符。

NOTE: If these steps don't work, try the tips and troubleshooting suggestions below.

注意 :如果这些步骤不起作用,请尝试以下提示和故障排除建议。

Get more Excel data entry tips on my Contextures website.

在我的Contextures网站上获取更多Excel数据输入提示

提示和故障排除 (Tips and Troubleshooting)

Update: Here are a few tips and troubleshooting suggestions, to use while you find and replace line breaks in Excel. Thank you to everyone who commented, and added suggestions.

更新 :以下是一些技巧和故障排除建议,可在您查找和替换Excel中的换行符时使用。 感谢所有发表评论并提出建议的人。

  • If Ctrl + J does not work, press the Alt key, and type 0010 on the number keypad (do not use the numbers above the letters)

    如果Ctrl + J不起作用,请按Alt键,然后在数字键盘上键入0010 (请勿使用字母上方的数字)

  • If the Excel file has never been saved, try saving the file before doing this find and replace

    如果从未保存过Excel文件,请在执行此查找和替换操作之前尝试保存文件
  • Try doing this find and replace when you first open Excel, before using the Find box for any other searches. Or, try the next tip -- you might have extra line breaks in the Find box.

    首次打开Excel时 ,请尝试执行此查找和替换操作,然后将“查找”框用于任何其他搜索。 或者,尝试下一条技巧-“查找”框中可能会有额外的换行符。

    1. Click on the Replace tab -- you'll see a light border around the word.

      单击“替换”选项卡-单词周围会出现一个浅边框。
    2. Press the Tab key -- that will select the Find What box, and anything that is entered there.

      按Tab键-将选择“查找内容”框以及在此输入的所有内容。
    3. Type Ctrl+J (that will replace anything that you previously typed in Find)

      键入Ctrl + J(它将替换您先前在“查找”中键入的任何内容)

视频:查找和替换换行符 (Video: Find and Replace Line Breaks)

Watch this short video, to see the steps for adding a line break in a cell. Then see how to find the line breaks in Excel, and replace them with space characters.

观看此简短视频,以了解在单元格中添加换行符的步骤。 然后查看如何在Excel中找到换行符,并用空格字符替换它们。

演示地址

翻译自: https://contexturesblog.com/archives/2013/05/28/find-and-replace-line-breaks-in-excel/

excel 替换 换行符

  • 0
    点赞
  • 0
    评论
  • 2
    收藏
  • 扫一扫,分享海报

参与评论 您还未登录,请先 登录 后发表或查看评论
©️2022 CSDN 皮肤主题:编程工作室 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值