Skip to content

A nifty little Excel macro that helps with merging or cross-checking two tables of data.

Notifications You must be signed in to change notification settings

isthisthat/InPlace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

InPlace README

Overview

InPlace is a nifty little module for Excel that helps with merging tables of information or cross-checking for overlapping data.

InPlace contains two macros:

  • Align In Place: For two tables of information on the same sheet and with sorted ids in the first column it will align the ids so that they match, inserting blank rows in either table whenever there is a mismatch.

Before and after alignment

  • Match in Place: For two tables of information on the same sheet and with the first table containing blank rows, it will insert blank rows on the second table to match those of the first. This macro can be used, for example, after Align In Place has introduced blank rows in your first table, to match a second table of information to the first, preserving the gaps.

Installation

  1. Download InPlace.bas from this repository to your computer (File -> Save)
  2. In Excel, you need to enable the Developer ribbon, as described here
  3. Click on the Editor button to open up the Project window
  4. Right-click anywhere in the white space of the Project window and select Import File...
    Module in Project window
  5. Browse for InPlace.bas (which you downloaded in step 1) and import it
  6. Prepare your Excel sheet (as described in the Overview) and click on Macros (from the Developer ribbon) and either AlignInPlace or MatchInPlace
    Macros window

Usage

NOTE:
Macros cannot be undone. Make sure you save your file before attempting to use these scripts to save yourself from ugly surprises!

Align In Place

Once you run the macro as described above, it will ask you for some information:

  • The first comparison column: This is the first column of the first table and must contain sorted ids
  • The first range column: This is the last column of the first table
  • The second comparison column: This is the first column of the second table and must contain sorted ids
  • The second range column: This is the last column of the second table
  • The starting row: If you have headers in the first row, enter "2"

Then you will get a confirmation dialog. Check if everything makes sense and click OK.
Confirmation dialog

Match In Place

Once you run the macro as described above, it will ask you for some information:

  • The template column: This is a column that contains some blank rows which you wish to instroduce to your target table
  • The first target column: This is the first column of the target table
  • The range column: This is the last column of the target table
  • The starting row: If you have headers in the first row, enter "2"
  • The end row: Since there are blank rows in your template column, there is no easy way to know where your data ends, so you need to enter the last row that contains data here (an estimate will be given by defualt)

Then you will get a confirmation dialog. Check if everything makes sense and click OK.

Help

I hope you find these macros useful. If you need more help, please contact me! I'd be happy to hear from you.
Please submit feature requests and bug reports via github.

About

A nifty little Excel macro that helps with merging or cross-checking two tables of data.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published