
Dear Eliza O. Riva
Thank you for submitting your question on the Q&A forum.
Based on the details you provided, I understand that you are seeking an optimal method to extract data from Excel according to your specific requirements. I have conducted research and tested a solution in my own test environment, and the results align precisely with what you are looking for.
Please follow the steps below to implement the solution:
- Open your Excel file.
- Press Alt + F11 to open the Visual Basic for Applications (VBA) editor.
- Click on Insert → Module.
- Paste the VBA code I have provided into the module window.
- Press F5 to run the code.
- Reopen your Excel file to verify the results.
VBA Code:
Sub SplitDataFromColumnA()
Dim i As Long
Dim arr As Variant
Dim lastRow As Long
lastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To lastRow
arr = Split(Cells(i, "A").Value, " ")
If UBound(arr) >= 0 Then
Cells(i, "B").Resize(1, UBound(arr) + 1).Value = arr
End If
Next i
End Sub
Kindly try these steps and let me know if the issue has been resolved. Should you encounter any further difficulties or require additional assistance, please do not hesitate to reach out. I am always available and happy to support you.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.