Sitemap
CodeToDeploy

Tech Insights | Careers | Jobs

Member-only story

Copy, Cut, and Insert

6 min readOct 24, 2026

--

Press enter or click to view image in full size
Photo by Aedrian Salazar on Unsplash

A column-reordering macro sounds simple: take a set of columns, find them by their headers, and put them in a particular order.

The business requirement is simple: Move these columns from wherever they are to these positions.

💥 Master AI & Tech Skills
💥 Crack Every Tech Interview with Confidence
🔥 Up to 70% OFF — Limited-Time Offer
👉 Enroll Now & Start Learning

Press enter or click to view image in full size

But there is an important engineering question hiding underneath that requirement: What does “move” actually mean to the program?

There are 2 ways to implement it.

  • One approach is to copy each source column into its destination.
  • Another is to cut the source column and insert it into the new position.

They may appear to produce the same result, but they do not necessarily have the same safety properties.

The first implementation: copy into the destination

Consider a simplified version of the first approach:

--

--

Maria Eloisa Pedro
Maria Eloisa Pedro

Written by Maria Eloisa Pedro

Data Analyst Lead, land use planning practitioner, night-shift warrior, and currently someone navigating life with a brain arteriovenous malformation (AVM).