简体   繁体   中英

How to split Excel row into multiple based on value in cell

I would like to split the rows out in the first table based on comma separated values in Column C.

So columns A,B,D,E would be duplicated for each comma separated value in column C.

So the data would result in the table below.

Thanks

图片

Here's an algorithmic approach you can try

  1. Get a reference to your data range
  2. Loop over the rows in that range
  3. Since you're going to be adding rows, loop bottom to top
  4. For each row
  5. Split the value in column C
  6. If the resulting array has > 1 values, insert rows for the new values
  7. Copy Values into the new rows
  8. Transpose the Split array into column C
  9. Repeat

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM