Question: I have this cell that has a list of things, for example:

```
[dogs, cats, mice, cows, horses]

```

And I want to separate them in different cells:

```
[dogs]
[cats]
[mice]
[cows]
[horses]

```

Can this be done?

Answer: 
You can easily do this in `VBA`:

```
Sub splitString ()
    Dim ran, splitS() As String
    ran = Range("A1")
    splitS() = Split(ran, ",")
    For j = LBound(splitS) To UBound(splitS)
    Range("B" & (j + 1)) = splitS(j)
    Next j
End Sub

```

If you also want the *square brackets*, use this code below:

```
Sub splitStringWithSquareBrackets()
    Dim ran, splitS() As String
    ran = Range("A1")
    ran = Right(ran, Len(ran) - 1)
    ran = Left(ran, Len(ran) - 1)
    splitS() = Split(ran, ",")
    For j = LBound(splitS) To UBound(splitS)
    Range("B" & (j + 1)) = "[" & splitS(j) & "]"
    Next j
End Sub

```
With data in cell **A1**:

```
Sub dural()
    Dim s As String, i As Long

    s = Range("A1").Value
    s = Mid(s, 2, Len(s) - 2)
    ary = Split(s, ", ")
    i = 2

    For Each a In ary
        Cells(i, "A").Value = "[" & a & "]"
        i = i + 1
    Next a
End Sub

```

[![enter image description here](https://i.stack.imgur.com/QMowE.png)](https://i.stack.imgur.com/QMowE.png)