VBA Split String Loop

前端 未结 2 550
北荒
北荒 2021-01-21 09:16

I am trying to split a string and create a loop for going through the cells in the column.There are a few challenges:

  1. Split works for ActiveCell on

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-21 09:44

    To address the issues you list

    1. Split acts on the string you pass to it. You are passing the active cell value to it.
    2. You don't update the result of split (FullName) inside the loop. So what else do you expect?
    3. Split Returns a zero-based, one-dimensional array. It says so right there in the help. Option Base 1 specifies the default lower bound, for when you don't specify it in a Dim statement.
    4. You are specifying the column in your code Cells(y, i + 1) (i + 1 in this case). If you want it somewhere else, specify a different column.

提交回复
热议问题