How can I separate cell contents at a character?

JOSHSKORN

New Member
Joined
Aug 22, 2022
Messages
15
Office Version
  1. 2019
Platform
  1. Windows
I have a song list that I copied and pasted from a website that looks like this:
Song Title - Artist
So, there's a dash that separates the two. Lets say I have this in Cell A2 (headings in row 1) and in Cells B2 and C2, I want "Song Title" and "Artists", respectively. How can I achieve this?

I would be comfortable using VBA if I have to.

I know I'd have to find the position of the Dash, read before, then after it, then trim the space before and after the dash. I'm just not sure how to do that.
 
Copy your text into Cell A1 in an empty sheet and run this snippet to find what the character is.
Code:
Sub Get_ASCII_Values_Cell_A1()
    Dim i As Long
    For i = 1 To Len(Range("A1"))
        Cells(i, 2).Value = Mid(Range("A1").Value, i, 1) & "    ="
        Cells(i, 3).Value = Asc(Mid(Range("A1").Value, i, 1))
    Next i
End Sub
 
Upvote 0

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,216,125
Messages
6,128,998
Members
449,480
Latest member
yesitisasport

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