excel如何去掉换行符号_去掉文本中所有换行符

excel如何去掉换行符号_去掉文本中所有换行符excel中添加换行符::alt+enter去掉excel中的换行符有三种方法:注:解决过程中翻阅其他博客,看到如下方式:1、看到有的说全选后“取消自动换行”,保存后,再打开,依然存在换行符

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺

excel 中添加换行符:

  :alt+enter

去掉excel中的换行符有三种方法:

注:解决过程中翻阅其他博客,看到如下方式:

1、看到有的说全选后“取消自动换行”,保存后,再打开,依然存在换行符

2、ctrl+H,然后按住alt输入“10”或者“0010”,然后替换,测试无效,可能我操作不对

解决办法:

M1:

  1. 直接查找替换,选中你要替换的位置or全选(ctrl+a)
  2. 然后按 ctrl+h,打开替换界面
  3. 在替换内容窗口,输入ctrl+j,看起来是空的,但是你能看到一个点闪烁。
  4. 在替换为窗口,输入你要替换的内容,什么也不输入表示删掉
  5. 然后按照需要选择全部替换,或者替换

M2 and M3:不翻译了,看起来有点麻烦

原文链接:https://www.ablebits.com/office-addins-blog/2013/12/03/remove-carriage-returns-excel/

Delete line breaks using Excel formulas

Pros: you can use a formula chain / nested formulas for complex cell text processing. For example, it is possible to remove carriage returns and then eliminate excess leading and trailing spaces and those between words.

Or you may need to delete carriage returns to use your text as an argument of another function without changing the original cells. For example, if you want to be able to use the result as an argument of the function =lookup ().

Cons: you’ll need to create a helper column and follow many extra steps.

  1. Add the helper column to the end of your data. You can name it “1 line”.
  2. In the first cell of the helper column (C2), enter the formula to remove / replace line breaks. Here you can see several helpful formulas for different occasions:
    • Handle both Windows and UNIX carriage return/ line feeds combinations.
      =SUBSTITUTE(SUBSTITUTE(B2,CHAR(13),""),CHAR(10),"")
    • The next formula will help you replace line break with any other symbol (comma+space). In this case lines will not join and extra spaces will not appear. 
      =TRIM(SUBSTITUTE(SUBSTITUTE(B2,CHAR(13),""),CHAR(10),", ")
    • If you want to remove all nonprintable characters from text, including line breaks:
      =CLEAN(B2)

    Excel formula to delete carriage returns from cells

  3. Copy the formula across the other cells in the column.
  4. Optionally, you can replace the original column with the one where the line breaks were removed:
    • Select all cells in column C and press Ctrl + C to copy the data to clipboard.
    • Now pick the cell B2 and press the Shift + F10 shortcut. Then just press V.
    • Remove the helper column.

VBA macro to get rid of line breaks

Pros: Being created once, can be reused in any workbook.

Cons: you need to have the basic knowledge of VBA.

The VBA macro from the example below deletes carriage returns from all cells in the currently opened worksheet (active worksheet).

 
Sub
RemoveCarriageReturns()
    
Dim
MyRange
As
Range
    
Application.ScreenUpdating =
False
    
Application.Calculation = xlCalculationManual
 
    
For
Each
MyRange
In
ActiveSheet.UsedRange
        
If
0 < InStr(MyRange, Chr(10))
Then
            
MyRange = Replace(MyRange, Chr(10),
""
)
        
End
If
    
Next
 
    
Application.ScreenUpdating =
True
    
Application.Calculation = xlCalculationAutomatic
End
Sub

If you don’t know VBA really well, see How to insert and run VBA code in Excel

 

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/167854.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 基于单片机的八路抢答器的设计与实现_基于单片机的三路抢答器设计

    基于单片机的八路抢答器的设计与实现_基于单片机的三路抢答器设计1.设计要求:1.以单片机为核心,设计一个八位竞赛抢答器:同时供八名选手或八个代表队比赛,分别用八个按钮S0~S7表示。2.设置一个系统清除和抢答控制开关S,开关由主持人控制。3.抢答器具有锁存与显示功能。即选手按按钮,锁存相应的编号,并在优先抢答选手的编号一直保持到主持人将系统清除为止。4.抢答器具有定时抢答功能,且一次抢答的时间由主持人设定(如30秒)。5.当主持人启动“开始”键后,定时器进行减计时,同时扬声器发出短暂的声响,声响持续的时间为0.5s左右。6.参赛选手在设定的时间

    2022年10月9日
    4
  • 五万字总结,深度学习基础。「建议收藏」

    五万字总结,深度学习基础。「建议收藏」文章目录1基本概念1.1神经网络组成?1.2神经网络有哪些常用模型结构?1.3如何选择深度学习开发平台?1.4为什么深层神经网络难以训练?1.5深度学习和机器学习的异同?2网络操作与计算2.1前向传播与反向传播?2.2如何计算神经网络的输出?2.3如何计算卷积神经网络输出值?2.4如何计算Pooling层输出值输出值?2.5实例理解反向传播2.6神经网络更“深”有什么意义?3超参数3.1什么是超参数?3.2如何寻找超参数的最优值?3.3超参数搜索一般过程?4激活函数4

    2022年5月21日
    41
  • Win7如何分享局域网并设置共享文件夹账户和密码

    Win7如何分享局域网并设置共享文件夹账户和密码

    2021年10月9日
    65
  • sqlmap报错注入

    sqlmap报错注入0x00背景学习记录一下报错型的注入,经各方整理和自己总结形成。所有的注入原理都是一样,即用户输入被拼接执行。但后台数据库执行语句产生错误并回显到页面时即可能存在报错注入。0x01概念报错型注入的利用大概有以下3种方式:复制代码1:?id=2’and(select1from(selectcount(*),concat(floor(rand(0)*2),(select(…

    2022年9月29日
    4
  • 根据IP地址和子网掩码求网络号、主机号

    根据IP地址和子网掩码求网络号、主机号一、理论阐述目前,IP地址主要使用32位的二进制来表示,即IPv4地址。由于32位二进制不容易记忆和书写,故采用点分十进制形式来表示IP地址。IP地址由两部分组成{<网络号>,<主机号>},网络号表示计算机所在的网络,供路由器在进行路由选择时使用;主机号是计算机在该网络中的唯一标识。IP地址分为A、B、C、D、E五类,其中:A类IP地址第一个字节的范围是:1~126…

    2022年6月24日
    32
  • PyXll-Jupyter

    PyXll-JupyterPyXll-Jupyter可以将Jupyter嵌入到excel中,可以在excel中调用python函数。

    2025年8月7日
    4

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号