Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default How do you do this? Uncrosstab

I need help on how to do this... we have bom data on excel where one
cell as multiple values separated by comma(,). I need this values
transpose as rows (it's like the comma is symbol for a new row. Is
there a way to do this? here's an example of a data I originally have
on one cell "1,2,3,4,5,6,7" I need them to be on this format.

A(column)
1
2
3
4
5
6
7

Is this possible to do this on Excel? I appreciate any help....

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default How do you do this? Uncrosstab

Anything is possible on excel.
Try this. Change A1 to your cell.
And Cells(i + 1, 2), 2 = B, 1 = 1, so it is B1

Sub macro1()
Dim sArray() As String
sArray = Split(Range("A1").FormulaR1C1, ",")

Dim i As Long, last As Long
i = 0
last = UBound(sArray) - 1
Do Until i last
Cells(i + 1, 2).FormulaR1C1 = CStr(sArray(i))
i = i + 1
Loop
End Sub


that's it. Cheers.

"Marve" wrote:

I need help on how to do this... we have bom data on excel where one
cell as multiple values separated by comma(,). I need this values
transpose as rows (it's like the comma is symbol for a new row. Is
there a way to do this? here's an example of a data I originally have
on one cell "1,2,3,4,5,6,7" I need them to be on this format.

A(column)
1
2
3
4
5
6
7

Is this possible to do this on Excel? I appreciate any help....


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default How do you do this? Uncrosstab

Hi jChen,

It works! Thanks a lot! I have another question if you don't mind.
Using the same code. I'm thinking of transposing the new rows to a new
worksheet. Is there a way to do this?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default How do you do this? Uncrosstab

I have another problem, how do I automatically run this peace if code
on selected cells? because it's tedious having to change the cell/s on
the code... is there a way to do this based on range of cells selected?
Thanks
Appreciate any help...

jchen wrote:
Anything is possible on excel.
Try this. Change A1 to your cell.
And Cells(i + 1, 2), 2 = B, 1 = 1, so it is B1

Sub macro1()
Dim sArray() As String
sArray = Split(Range("A1").FormulaR1C1, ",")

Dim i As Long, last As Long
i = 0
last = UBound(sArray) - 1
Do Until i last
Cells(i + 1, 2).FormulaR1C1 = CStr(sArray(i))
i = i + 1
Loop
End Sub


that's it. Cheers.

"Marve" wrote:

I need help on how to do this... we have bom data on excel where one
cell as multiple values separated by comma(,). I need this values
transpose as rows (it's like the comma is symbol for a new row. Is
there a way to do this? here's an example of a data I originally have
on one cell "1,2,3,4,5,6,7" I need them to be on this format.

A(column)
1
2
3
4
5
6
7

Is this possible to do this on Excel? I appreciate any help....



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default How do you do this? Uncrosstab

I already figured this out.


Marve wrote:
I have another problem, how do I automatically run this peace if code
on selected cells? because it's tedious having to change the cell/s on
the code... is there a way to do this based on range of cells selected?
Thanks
Appreciate any help...

jchen wrote:
Anything is possible on excel.
Try this. Change A1 to your cell.
And Cells(i + 1, 2), 2 = B, 1 = 1, so it is B1

Sub macro1()
Dim sArray() As String
sArray = Split(Range("A1").FormulaR1C1, ",")

Dim i As Long, last As Long
i = 0
last = UBound(sArray) - 1
Do Until i last
Cells(i + 1, 2).FormulaR1C1 = CStr(sArray(i))
i = i + 1
Loop
End Sub


that's it. Cheers.

"Marve" wrote:

I need help on how to do this... we have bom data on excel where one
cell as multiple values separated by comma(,). I need this values
transpose as rows (it's like the comma is symbol for a new row. Is
there a way to do this? here's an example of a data I originally have
on one cell "1,2,3,4,5,6,7" I need them to be on this format.

A(column)
1
2
3
4
5
6
7

Is this possible to do this on Excel? I appreciate any help....



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"