0

如何增加这个公式

=IF(ISERROR(FIND(" ",TRIM(A1),1)),TRIM(A1),MID(TRIM(A1),FIND(" ",TRIM(A1),1),LEN(A1)))

按症状原因解决方法将以下数据分成列

L=Cannot print in UNIX

症状:无法在 UNIX 中打印或绘图 原因:配置问题

解决方案:升级到相应的团队 升级路径:OEMM GIT 桌面参考:关键字:ZEH 创建:

4

1 回答 1

0

我喜欢变得凌乱和复杂,但这可以很容易地完成旧时尚风格。

hit Ctrl H 
replace your multiple line break chars (i.e. "1234") with a single wild char "~" or "}" are usually good
use Excel's feature "text to columns" to break the line based on your wild char separator. (ctrl +A, +E)

如果您只有一个空格“”来分隔列,只需使用文本到列,选中分隔,然后在其他分隔符下点击“”,然后完成。当然,在执行此操作之前,您应该复制列(在 C 列上粘贴/特殊值,然后将其断开以保留 B 列上的初始值):) 希望对您有所帮助。

编辑

这是我写的一段代码(有点匆忙)。这遵循上面的示例,用户输入用于列选择和用于中断文本的字符字符串。如果您只需要使用空格作为“文本分隔符”,则在第二个提示符中输入“”。通常我会花时间“清理”代码,但这就是 10 分钟的结果:

Sub SplitColumns()

DestinationColumn = InputBox("Please enter the name of the column you on which you want to perform the split", _
                "Column Selection", "A", 100, 100)

Dim ReplaceRange As Range: Set ReplaceRange = ActiveSheet.Range(DestinationColumn & ":" & DestinationColumn)

SeparatorString = InputBox("Please enter the string of charatesrs used to define the split", _
                "String Definition", "anything goes", 100, 100)

' Please be carefull and check for anythinkg like "~" as it will produce errors if found within the cell text

Dim Response As Integer
Response = MsgBox(prompt:= _
        "Are you sure you want to split the text from column [" & DestinationColumn & "] based on [" & SeparatorString & "] ?" & vbNewLine & _
        "Once the macro is run, there is no Undo Option available(Ctrl+Z)", _
        Buttons:=vbYesNo)
If Response = vbYes Then
ReplaceRange.Replace _
    What:=SeparatorString, _
    Replacement:="~", _
    LookAt:=xlPart, _
    SearchOrder:=xlByRows, _
    MatchCase:=False, _
    SearchFormat:=False, _
    ReplaceFormat:=False

ReplaceRange.TextToColumns _
    Destination:=Range(DestinationColumn & "1"), _
    DataType:=xlDelimited, _
    TextQualifier:=xlDoubleQuote, _
    ConsecutiveDelimiter:=False, _
    OtherChar:="~", _
    FieldInfo:=Array(Array(1, 1), Array(2, 1)), _
    TrailingMinusNumbers:=True
End If

End Sub

也许我会再给这段代码做一次整容(其他时间)。希望不需要调试。我已经在 Excel 2007 上对其进行了测试。干杯!

于 2013-11-14T13:37:18.073 回答