首页 > 解决方案 > Split cell content by "';" using VBA or Excel formula

问题描述

I am new to VBA, so I have trouble writing code in VBA. My problem is writing a code or an Excel formula to extract (for later use) the identifiers that are written in the same cell, split by ";".

For example, this is what I have on a cell: A11;B22;C33

I need to select A11, B22, C33, as they were written for example, on a column, as different cells, so I can later use them in other formulas. I don't want to split the content into different columns, I just want to be able to use A11 or B11 furthermore, without editing it in the databse

Thank you!

标签: vbaexcelexcel-formula

解决方案


您可以使用拆分功能并通过分隔符(;在你的情况下)

例如:

Var arrayResult = Split("A11;B22;C33",";")

您还可以在 excel 中使用文本到列实用程序。

选择要分隔的文本

  • 转到数据 >
  • 选择文本到列>
  • 选择分隔选项单击下一步>
  • 选择您喜欢的分隔符;
  • 点击下一步

您将获得单独的值。


推荐阅读