需要将Excel VBA中的值拆分为两个单元格
我有一个相当简单的问题。我只是无法弄清楚如何做到这一点。
我在 Excel 中有一系列单元格,如下所示:
Row ColA
1 B001
2 B002
3 B003
4 B004
5 B005
我需要知道如何在 VBA 中拆分这些单元格,以便它们现在如下所示:
ColB ColC
1 B 001
2 B 002
3 B 003
4 B 004
5 B 005
我知道您在 VBA 中使用 SPLIT 命令,但我很难知道如何填充其余的。有人可以帮忙吗?
这是一张图片,可帮助描述我在 Excel 中拥有/需要的内容
I have a fairly simple question. I just can't for the life of me figure out how to do this.
I have a range of cells in Excel like so:
Row ColA
1 B001
2 B002
3 B003
4 B004
5 B005
I need to know how to split these cells in VBA so that they now are like so:
ColB ColC
1 B 001
2 B 002
3 B 003
4 B 004
5 B 005
I know you use the SPLIT command in VBA, but I'm struggling to know how to fill in the rest. Can anyone help?
Here is a picture to help describe what I have/need in Excel
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解析数字文本
测试 1
测试 2(不打乱数字格式)
测试 3(使用
TextToColumns
不打乱数字格式)两个 (
2
) 表示 As Text,零 (0
) 表示第一个字符(在第 0 个字符之后),一(1
) 表示第一个字符之后。Parse Numeric Text
Test 1
Test 2 (without messing with the number format)
Test 3 (Using
TextToColumns
without messing with the number format)The twos (
2
) mean As Text, the zero (0
) means first char (after the 0th char) and one (1
) means after the first char.