I need a function in excel that I can call and pass to a cell. Input data:
Firstname Lastname email@mail.com Firstname midname Lastname email@mail.com
The number of gaps between them is random. The output should be just an array. An array can be of any length, since I do not know what the lines look like. The output should be:
Firstname, Lastname, email@mail.com Firstname, midname, Lastname, email@mail.com
I will call a function from one cell, for example =MySplitFunction(A1) , and this should put the name in A1, Lastname in B1 and email@mail.com in C1. I created a new module and tried the following code:
Function MySplitFunction(s As String) As String() MySplitFunction = Split(s, " ") End Function
Which gives me a conclusion
Firstname
How do I get it to return the whole array? Is it even possible to write a function in one cell that will put the material in the cells next to it?
EDIT:

string split vba excel
Goatcat
source share