Bryan Ward

Logo

About

All Posts

Recordings

Contact

Excel: Copy as JSON

9 April 2025

A new twist on my existing Copy As CSV macro, this code will copy the selected cells in an Excel spreadsheet as a JSON document to your clipboard.

image

Install this in Excel using the same instructions as provided in my Copy as CSV post, but just use the below code instead. It will return a list of dicts, with keys based on the first row of the selected cells. Each row in the selection becomes an item in the list. All values are treated as strings for simplicity.


tags: code - excel

I certify that none of the text contained within the articles on this site has been generated or edited by any AI technology. I've been a fan of the em dash for many years and am known to use big words from time to time.
This page uses cookies — if that's a problem, then don't use the Internet.
Copyright © Bryan Ward