Splitting text into columns at space every time data changes using VBA

Andrew1234

New Member
Joined
Feb 1, 2023
Messages
29
Office Version
  1. 2013
Platform
  1. Windows
Hi, I have been heavily researching on how to split information in one cell and have it put into columns using vba.
Any codes I found online either needed me to run the macro every time or they didn't work. I would like it to run every time data is added on this particular sheet.
I have a very basic understanding of vba and simply do not know how to write the coding.

Here are some images showing what I want to achieve.

excel.PNG

excel1.PNG


from these images you can see that I need to split information from column A across columns B - H.
I would like the information to be split straight away as soon as the information comes into column A. I hope this can be done.

Just to make you aware, I also have a simple code for this worksheet that simply move on to the next cell automatically after the information is scanned in using the barcode scanner.

Here is an image of the code used for moving to the next cell.
excelvba.PNG



If someone could help me with this issue it would be much appreciated.
Many thanks for your help in advance!
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
You can test following
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
' In Sheet Module
Dim ChangedCell As Range
Set ChangedCell = Range(Target.Address)
Application.Run ("TextinCols")
'Select the next cell
ChangedCell.Offset(1, 0).Select
End Sub

Sub TextinCols()
' In Standard Module - Rick's macro
 ActiveCell.TextToColumns ActiveCell.Offset(, 1), xlDelimited, , True, False, False, False, True, False
End Sub
SUCCESS!!!!

Thank you very much for your help!
Today is the third day of me trying to search for a solution for this, so I thank you!
And I also thank anyone else who has took the time to try and come up with a solution! It's amazing how you all know so much about this software.

Thanks to all.

@James006
@Rick Rothstein
@JvdV
@Georgiboy
@bebo021999
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,841
Members
449,051
Latest member
excelquestion515

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top