Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Macro to split the contents in a single cell separated by "," intonext cell in that column

Hi,

I have sheet 1:

column A column B columnC
WR# Phase SP#
Row2 60625 1-0110 60625RB1,60625NS1,60625GW1,60625BB1

Expected Output on clicking a button:

column A column B columnC
WR# Phase SP#
Row2 60625 1-0110 60625RB1
Row3 60625NS1
Row4 60625GW1
Row5 60625BB1


Is there a way to split the contents in cell C2 separated by comma (,)
and place it on next cell in column C itself?
Please suggest.Thankyou.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Macro to split the contents in a single cell separated by ","into next cell in that column

On Jan 21, 11:29*am, anshu minocha wrote:
Hi,

I have sheet 1:

* * * * column A * *column B *columnC
* * * * WR# * * * * *Phase * * * SP#
Row2 60625 * * * 1-0110 * * * 60625RB1,60625NS1,60625GW1,60625BB1

Expected Output on clicking a button:

* * * * *column A * *column B *columnC
* * * * *WR# * * * * *Phase * * * SP#
Row2 60625 * * * 1-0110 * * * 60625RB1
Row3 * * * * * * * * * * * * * * * * *60625NS1
Row4 * * * * * * * * * * * * * * * * 60625GW1
Row5 * * * * * * * * * * * * * * * * 60625BB1

Is there a way to split the contents in cell C2 separated by comma (,)
and place it on next cell in column C itself?
Please suggest.Thankyou.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Macro to split the contents in a single cell separated by ","into next cell in that column

Found the code:
http://groups.google.com/group/micro...5587d778c2c275
thanks
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Macro to split the contents in a single cell separated by "," into next cell in that column

Here is another way to do it...

Sub SplitDownwardColumnC()
Dim X As Long, LastRow As Long, StartRow As Long
Dim Cell As Range, Parts As Variant
StartRow = 2
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
For X = LastRow To StartRow Step -1
Parts = Split(Cells(X, "C").Value, ",")
Rows(X).Offset(1).Resize(UBound(Parts)).Insert
Cells(X, "C").Resize(UBound(Parts) + 1).Value = _
WorksheetFunction.Transpose(Parts)
Next
End Sub

--
Rick (MVP - Excel)


"anshu minocha" wrote in message
...
Found the code:
http://groups.google.com/group/micro...5587d778c2c275
thanks


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Splitting out Content in 1 cell (which is currently separated by"ALT-ENTER") into multiple cells Sunil Ahuja Excel Discussion (Misc queries) 1 March 24th 09 04:27 PM
Convert cell "contents" into a "comment" Ryan Excel Discussion (Misc queries) 4 October 3rd 08 11:34 PM
how to increase size of "name box" and "contents of cell " displa. Stubby- LIBERTY New Users to Excel 2 February 22nd 07 06:43 PM
if one cell has "X" textin contents, then pull cell "Y"... azazel Excel Worksheet Functions 3 October 24th 05 05:43 PM
How do I split "A1B2" into "A1" and "B2" using text to column fun. Jennifer Excel Programming 1 February 2nd 05 10:01 PM


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

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

About Us

"It's about Microsoft Excel"