Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一列的excel文档。它看起来像这样:
car /VIj+ car, cars /VIj- home, homes /VKjsah+ homeless, homeless /VKjsbh+ . . .
而且我需要在每列中删除符号/包括符号/之后的所有内容。然后我需要将带有两个单词的单元格划分为单独的单元格并删除位于单词之间的符号。有人可以帮助我吗?
假设您的数据在单列中,并且数据列右侧有空列。如果是这样,您可以为包含数据的选定范围运行此代码:
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
下图展示了宏的结果。