Skip to content

A small tool that takes Excel rows with multi line cells and splits them into separate rows while keeping key columns merged

Notifications You must be signed in to change notification settings

CognitionIES/excel-multiline-row-splitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Excel Multiline Row Splitter

This project fixes Excel sheets where some cells contain more than one line because someone used ALT+ENTER. Those stacked lines create issues when the data needs to be filtered or processed.

The tool turns every line into its own row and keeps the main columns aligned.

What it does

  • Looks for cells that have multiple lines inside them
  • Splits each line into a new row
  • Keeps P&ID, Line Number, and other fixed columns in place
  • Matches the structure shown in your “correct” example where repeated values stay merged or consistent across the new rows

Why I built it

I had a sheet where one row held several instrument tags in the same cell, and it made sorting and checking the data messy. Splitting everything by hand would take too long.

This script automates the whole thing.

How it works

  1. Open your Excel file
  2. Run the script (VBA or Python version, depending on what this repo contains)
  3. The tool checks the target columns
  4. Every line break becomes a new row
  5. The rest of the row is copied so the data stays aligned

How to run it

If you’re using the VBA version

  • Open Excel
  • Press ALT + F11
  • Insert a new module
  • Paste the code from this repo
  • Run the macro on your sheet

If you’re using the Python version

  • Install openpyxl

  • Place your Excel file in the same folder

  • Run

    python split_rows.py
    
    
  • The script creates a cleaned file with the updated rows

Files in this repo

  • Script file (VBA or Python)
  • Sample Excel (optional)
  • README

About

A small tool that takes Excel rows with multi line cells and splits them into separate rows while keeping key columns merged

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages