How to split the Cell Content

akhendre88

Board Regular
Joined
Sep 17, 2015
Messages
76
Hello,

I receive an auto generated sheet every day in which multiple lines are combined in only one cell.

Every line ends with either ' or ). My objective here is to get each line in different cell. How can I get this done?

Will split() be useful in this scenario or is there any other way?

Thank you.
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Hello,

I receive an auto generated sheet every day in which multiple lines are combined in only one cell.

Every line ends with either ' or ). My objective here is to get each line in different cell. How can I get this done?

Will split() be useful in this scenario or is there any other way?
Do you have only one column of data to process? If not, then what should be done with the other columns of data?
 
Upvote 0
No, there will be only one column.

Currently, I have all the data in 'A1', and I want to split it in such a way that first line should go in A1, 2nd in A2 and so on...!!

Thank you.
 
Upvote 0
No, there will be only one column.

Currently, I have all the data in 'A1', and I want to split it in such a way that first line should go in A1, 2nd in A2 and so on...!!
Give this macro a try...
Code:
[table="width: 500"]
[tr]
	[td]Sub SplitDataInCellA1()
  Dim Arr As Variant
  Arr = Split(Range("A1"), vbLf)
  Range("A1").Resize(UBound(Arr) + 1) = Application.Transpose(Arr)
End Sub[/td]
[/tr]
[/table]
 
Upvote 0

Forum statistics

Threads
1,214,621
Messages
6,120,568
Members
448,972
Latest member
Shantanu2024

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