我想创建一个自定义函数,它接受选定的参数并将其内容拆分到不同的单元格上。
例子 :
A1=ABCDE
变成
B1=A, C1=B, D1=C, E1=D, F1=E
这就是我尝试过的:
Function SplitWord(Word)
NbCar = Len(Word) // get the number of cardinals of the text
SplitWord = Left(Word, 1) // put the first letter in the cell that called the function
t = NbCar - 1
For i = 1 To t
ActiveCell.Offset(0, i) = Right(Left(Word, i), 1)
Next
End Function
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
28578 次 |
| 最近记录: |