使用mid函数.
=MID($A$1,1,1)
Run Code Online (Sandbox Code Playgroud)
第二个参数是起始位置,因此您可以将其替换为row或col函数之类的内容,以便您可以动态拖动公式.
即.
=MID($A$1,ROW(),1)
Run Code Online (Sandbox Code Playgroud)
如果你想纯粹在VBA中这样做,我相信mid函数也存在于那里,所以只需循环遍历字符串.
Dim str as String
str = Sheet1.Cells(1,1).Value
for i = 1 to Len(str)
'output string 1 character at a time in column C
sheet1.cells(i,3).value = Mid(str,i,1)
next i
Run Code Online (Sandbox Code Playgroud)
*编辑*
如果要使用数组中的多个字符串执行此操作,可以使用以下内容:
Dim str(1 to 2) as String
str(1) = "This is a test string"
str(2) = "Some more test text"
for j = Lbound(str) to Ubound(str)
for i = 1 to Len(str(j))
'output strings 1 character at a time in columns A and B
sheet1.cells(i,j).value = Mid(str(j),i,1)
next i
next j
Run Code Online (Sandbox Code Playgroud)