Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default Text to Rows and then Insert Blank Rows

I have a set of data - about 500 rows worth. Data in Colums A:C
contain the single values that I don't need to put into columns. The
data in Column D, though, is ";" delimited and I need to put that in
individual rows. I have a macro that will parse the data, but I need
to have it insert the number of blank rows down so that the other data
below it doesn't get out of line. An example data set is below

Detroit Cars Compact New;clean;5
years;special

Chicago Vans Full Old;dirty;
55k miles, not special;boring;needs repair

So I would like to have the macro make the the above look like the
below:

Detroit Cars Compact New
Detroit Cars Compact Clean
Detroit Cars Compact 5 years
Detroit Cars Compact special
Chicago Vans Full Old
Chicago Vans Full Dirty


I just need the rows inserted down for as many data points there are
in column D. I can make Columns A through C repeat their values.
Please let me know how to proceed.

I would prefere a formula or VBA. Text to columns and transpose is
not the desired solution.

Thanks in advance.

Conor
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Text to Rows and then Insert Blank Rows

Sub seperate()

RowCount = 1
Do While Range("A" & RowCount) < ""
Data = Range("D" & RowCount)
Do While InStr(Data, ";") 0
FirstStr = Trim(Left(Data, InStr(Data, ";") - 1))
Data = Trim(Mid(Data, InStr(Data, ";") + 1))
Range("D" & RowCount) = FirstStr
Rows(RowCount + 1).Insert
Range("A" & RowCount & ":C" & RowCount).Copy _
Destination:=Range("A" & (RowCount + 1))
RowCount = RowCount + 1
Range("D" & RowCount) = Data
Loop
RowCount = RowCount + 1
Loop
End Sub




" wrote:

I have a set of data - about 500 rows worth. Data in Colums A:C
contain the single values that I don't need to put into columns. The
data in Column D, though, is ";" delimited and I need to put that in
individual rows. I have a macro that will parse the data, but I need
to have it insert the number of blank rows down so that the other data
below it doesn't get out of line. An example data set is below

Detroit Cars Compact New;clean;5
years;special

Chicago Vans Full Old;dirty;
55k miles, not special;boring;needs repair

So I would like to have the macro make the the above look like the
below:

Detroit Cars Compact New
Detroit Cars Compact Clean
Detroit Cars Compact 5 years
Detroit Cars Compact special
Chicago Vans Full Old
Chicago Vans Full Dirty


I just need the rows inserted down for as many data points there are
in column D. I can make Columns A through C repeat their values.
Please let me know how to proceed.

I would prefere a formula or VBA. Text to columns and transpose is
not the desired solution.

Thanks in advance.

Conor

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
Insert Blank Rows igbert Excel Discussion (Misc queries) 5 October 27th 08 01:52 PM
insert 3 blank rows after every 2 rows Nikhil Excel Discussion (Misc queries) 1 September 25th 08 12:57 PM
Need to insert blank rows Gaurav[_3_] Excel Worksheet Functions 2 June 26th 08 07:55 PM
How do i insert blank rows between data that is thousands of rows paul.eatwell Excel Discussion (Misc queries) 5 April 14th 08 10:49 PM
How do I insert blank rows between rows in completed worksheet? bblue1978 Excel Discussion (Misc queries) 1 October 26th 06 07:02 PM


All times are GMT +1. The time now is 09:31 AM.

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"