[英]How to delete everything after special charcter in each column in Excel document and divide two words from one cell to two separate cells?
I have excel document with one column. 我有一栏的Excel文档。 It looks like this:
看起来像这样:
car /VIj+
car, cars /VIj-
home, homes /VKjsah+
homeless, homeless /VKjsbh+
.
.
.
And I need to delete everything after symbol / including symbol / in each column. 我需要删除每列中的符号(包括符号)之后的所有内容。 Then I need to divide cells with two words in to the separate cells and delete symbol , which is between words.
然后,我需要将具有两个单词的单元格划分为单独的单元格,并删除单词之间的symbol。 Can somebody help me?
有人可以帮我吗?
Assuming that your data are in single column and there are empty columns right to the data column. 假设您的数据在单个列中,并且数据列右边有空列。 If so you could run this code for selected range containing data:
如果是这样,您可以针对包含数据的选定范围运行此代码:
Sub Solution()
Dim tmpArr
Dim Cell As Range
For Each Cell In Selection.Cells
tmpArr = Split(Split(Cell, "/")(0), ",")
Cell.Resize(1, 1 + UBound(tmpArr)) = tmpArr
Next
End Sub
The following picture presenting results of the macro. 下图显示了宏的结果。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.