I am learning Excel-VBA and I am trying to learn how to do things that will help me in the future. I have been trying to learn how to do a simple split without a loop. Although I got a code that I could use, I could not understand it.
Excel VBA- Copy and paste text on left after CHAR(10)
I have this mock from what I learned in the code I was pointed towards. I feel like I am close but no matter what I do I can not make the syntax work. Any help would be greatly appreciated.
I attached the code and a snippet of what I would like to see before and after. My code does not work in this line.
Worksheets("Sheet1").Cells(1, 2).Value = fullname
The code is below
Sub test()
Dim txt As String
Dim fullname As String
txt = Worksheets("Sheet1").Cells(1, 1).Value
fullname = Split(txt, Chr(10))
Worksheets("Sheet1").Cells(1, 2).Value = fullname
End Sub
