单元格中有数据后,请运行以下简短宏:
Sub FixHardReturns()
Dim CH As String, r As Range, v As Variant
CH = Chr(10)
For Each r In ActiveSheet.UsedRange
v = r.Value
If v <> "" Then
If InStr(1, v, CH) > 0 Then r.WrapText = True
End If
Next r
End Sub
宏非常易于安装和使用:
如果您保存工作簿,则宏将随其一起保存。如果您在2003年以后使用Excel版本,则必须将文件另存为.xlsm而不是.xlsx
删除宏:
要从Excel中使用宏,请执行以下操作:
要总体上了解有关宏的更多信息,请参见:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
和
http://msdn.microsoft.com/zh-CN/library/ee814735(v=office.14).aspx
必须启用宏才能使其正常工作!
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句