Excel vba

Hello,
can you please help,
is there a vba that can separate column "J"or "K", if the cell contains /
then separate and insert into a new line.

Please see sample attached. (original tab, after tab)

thank you,
Sample.xlsx
W.E.BAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SteveCommented:
If you could try:

Sub Macro1()

Dim x As Long: x = 2

Do While Len(Cells(x, "J")) > 0
    
    If Cells(x, "J") Like "*/*" Then
    Rows(x & ":" & x).Copy
    Rows(x + 1 & ":" & x + 1).Insert Shift:=xlDown
    Application.CutCopyMode = False
    Cells(x, "J") = Split(Cells(x, "J"), "/")(0)
    Cells(x, "K") = Split(Cells(x, "K"), "/")(0)
    On Error Resume Next
    Cells(x + 1, "J") = Right(Cells(x + 1, "J"), Len(Cells(x + 1, "J")) - (Len(Cells(x, "J")) + 1))
    Cells(x + 1, "K") = Right(Cells(x + 1, "K"), Len(Cells(x + 1, "K")) - (Len(Cells(x, "K")) + 1))
    On Error GoTo 0
    End If
   
x = x + 1
Loop
End Sub

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
W.E.BAuthor Commented:
perfect,
thank you
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.