ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Text to Rows (https://www.excelbanter.com/excel-discussion-misc-queries/227698-text-rows.html)

N1KO

Text to Rows
 
I know that converting text to columns is simple but i'm wondering if I can
create a macro to conver text to rows?

Would the easist way to do this be simply converting text to columns and
then transposing it to the rows or is there an easier way than this?

My text is e-mail addresses seperated by a comma with no spaces in between
the addresses.

Thanks in advance.

Mike H

Text to Rows
 
Hi,

You could write a macro but ut seems simplest to me to use text to columns
with a comma delimeter and then copy and paste special - transpose.

Mike

"N1KO" wrote:

I know that converting text to columns is simple but i'm wondering if I can
create a macro to conver text to rows?

Would the easist way to do this be simply converting text to columns and
then transposing it to the rows or is there an easier way than this?

My text is e-mail addresses seperated by a comma with no spaces in between
the addresses.

Thanks in advance.


Jacob Skaria

Text to Rows
 
As you mentioned text to columns with a comma delimeter and transpose is the
simplest way. If you really needa a macro please find the below

Sub Macro()
strData = "<comma separated email string"
arrData = Split(strData, ",")
For lngRow = 0 To UBound(arrData)
Range("A" & lngRow + 1) = arrData(lngRow)
Next
End Sub
--
If this post helps click Yes
---------------
Jacob Skaria


"N1KO" wrote:

I know that converting text to columns is simple but i'm wondering if I can
create a macro to conver text to rows?

Would the easist way to do this be simply converting text to columns and
then transposing it to the rows or is there an easier way than this?

My text is e-mail addresses seperated by a comma with no spaces in between
the addresses.

Thanks in advance.


N1KO

Text to Rows
 
Thanks for this Jacob but the e-mail string will constantly change in this
report. It's worked on a few others though.

Appreciated.

"Jacob Skaria" wrote:

As you mentioned text to columns with a comma delimeter and transpose is the
simplest way. If you really needa a macro please find the below

Sub Macro()
strData = "<comma separated email string"
arrData = Split(strData, ",")
For lngRow = 0 To UBound(arrData)
Range("A" & lngRow + 1) = arrData(lngRow)
Next
End Sub
--
If this post helps click Yes
---------------
Jacob Skaria


"N1KO" wrote:

I know that converting text to columns is simple but i'm wondering if I can
create a macro to conver text to rows?

Would the easist way to do this be simply converting text to columns and
then transposing it to the rows or is there an easier way than this?

My text is e-mail addresses seperated by a comma with no spaces in between
the addresses.

Thanks in advance.



All times are GMT +1. The time now is 08:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com