excel - 将字符串拆分为多个单元格
问题描述
我有个问题。
我有这个:
("boufous;othman;212544;casa")
我想将此单元格拆分为多个单元格,例如:
cell[1]=boufous
cell[2]=othman
cell[3]=212544
cell[4]=casa
For Each olMailItem In olItems
//Code here
i = i + 1
Next olMailItem
解决方案
假设 olMailItem 作为字符串,下面是代码
Dim str1, str2
olMailItem = "boufous;othman;212544;casa"
str1 = Split(olMailItem, ";")
str2 = UBound(str1)
For i = 0 To str2
Debug.Print str1(i)
Next i
推荐阅读
- javascript - node.js 使用模块而不将它们分配给变量
- azure-devops - 如何使用用于 Azure API 管理的 Azure DevOps 完成 CI/CD 管道
- php - 如何在php(coinmarket api)中使用foreach打印以下json数据
- windows - 什么是 Windows 中的零字节可执行文件
- javascript - 我可以使用 Javascript/angular 获得在线价值吗?
- ios - iOS 12 / 13 程序化视图创建
- r - 如何在阅读之前过滤 .csv 文件
- sql - 如何编写查询以仅显示在 4 个标签中有四个值的资产的结果?
- operating-system - 进程会出现饥饿吗?
- node.js - 使用 NodeJS 以编程方式获取所有浏览器中所有打开的选项卡的列表