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)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • RewriteRule指令[通俗易懂]

    RewriteRule指令[通俗易懂]作为RewriteRule指令的第三个参数。Flags是一个包含以逗号分隔的下列标记的列表: ‘last|L'(最后一个规则last)立即停止重写操作,并不再应用其他重写规则。它对应于Perl中的last命令或C语言中的break命令。这个标记可以阻止当前已被重写的URL为其后继的规则所重写。举例,使用它可以重写根路径的URL(‘/’)为实际存在的URL,比如,’/e/w

    2022年5月14日
    32
  • Mybatis分页查询limit

    Mybatis分页查询limit首先,写一下分页查询的原理:sql语句:#语法SELECT*FROMtableLIMITstratIndex,pageSizeSELECT*FROMtableLIMIT5,10;//检索记录行6-15#为了检索从某一个偏移量到记录集的结束所有的记录行,可以指定第二个参数为-1:SELECT*FROMtableLIMIT95,-1;//检索记录行96-last.#如果只给定一个参数,它表示返回最大的记录行数目:SELECT*FROMtableL

    2022年5月5日
    52
  • oracle怎样将数据库恢复到某个时间点之前_oracle删除时间段之前的数据

    oracle怎样将数据库恢复到某个时间点之前_oracle删除时间段之前的数据deletefromtablename;insertintotablenameselect*fromtablenameasoftimestampto_timestamp(‘2017-01-0811:00:00′,’yyyy-mm-ddhh24:mi:ss’)注意:1.表结构更改了不可使用此方法恢复数据;2.时间间隔不能太长(几个小时还是没…

    2022年9月23日
    0
  • burpsuite小米手机抓包_Android 7.0+手机burpsuite抓包https

    burpsuite小米手机抓包_Android 7.0+手机burpsuite抓包https记录一下以后可能会遇到的此类问题的解决方案。方法1:系统证书目录:/system/etc/security/cacerts/其中的每个证书的命名规则如下:.文件名是一个Hash值,而后缀是一个数字。文件名可以用下面的命令计算出来:opensslx509-subject_hash_old-in后缀名的数字是为了防止文件名冲突的,比如如果两个证书算出的Hash值是一样的话,那么一个证书的后缀名…

    2022年5月30日
    62
  • malloc函数实现原理!

    malloc函数实现原理!任何一个用过或学过C的人对malloc都不会陌生。大家都知道malloc可以分配一段连续的内存空间,并且在不再使用时可以通过free释放掉。但是,许多程序员对malloc背后的事情并不熟悉,许多人甚至把malloc当做操作系统所提供的系统调用或C的关键字。实际上,malloc只是C的标准库中提供的一个普通函数,而且实现malloc的基本思想并不复杂,任何一个对C和操作系统有些许了解的程序员都可以很

    2022年5月31日
    40
  • 电脑显卡驱动错误代码43怎么办?驱动人生解决方案「建议收藏」

    电脑显卡驱动错误代码43怎么办?驱动人生解决方案「建议收藏」如果驱动人生8全面诊断提示显卡代码43,那就可能意味着这个显卡有质量问题。因为显卡代码43至少90%以上概率都是显卡物理性坏了。如果你想解决显卡代码43问题,建议按照驱动人生的解决方案一个一个去尝试看看能不能解决。本文有点长,请耐心看。如何判断显卡代码43?下载打开驱动人生8——全面诊断——查看检测结果就能看到显卡是否有错误代码43,如果显示43,按照解决方案去操作即可。    显卡代码43的现象是怎么样的?显卡驱动提示安装成功,但重启电脑后,驱动人生又会报错代码43。或者现象是驱动完全安装失

    2022年6月28日
    110

发表回复

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

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