View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Martin Leese Martin Leese is offline
external usenet poster
 
Posts: 5
Default Need to conditionally duplicate rows

Hi,

Not sure if this is the correct group or not.
I need to massage an Excel spreadsheet.
Specifically, if a cell in a column contains
more than one element (separated by commas)
then I need to duplicate that row with one
element in each row. For example, I want to
convert this:
Stuff1 an element
Stuff2 one element, two element
Stuff3 another element

into this:
Stuff1 an element
Stuff2 one element
Stuff2 two element
Stuff3 another element

where "Stuff1" is in column 1, and
"an element" is in column 2.

Any ideas how I can do this? I can program
in more languages than I care to remember,
but have never used Visual Basic. Would
Visual Basic be able to do this, and where
might I find an example of something similar.

The spreadsheet has thousands of rows with
hundreds of rows which need to be duplicated.
Doing it by hand would therefore be a last
resort.

Many thanks for any help you can give.
--
Regards,
Martin Leese
E-mail: LID
Web:
http://members.tripod.com/martin_leese/