If you’re anything like me, seeing badly-formatted things like “12 m3” for “12 m3”, typos like “34 kgC02” for “34 kgCO2”– or worse, combinations like “100 KWh/m2” for “100 kWh/m2” – really rubs you up the wrong way. If it doesn’t then trust me, anyone copy editing, and many people just reading your work really hate you!

It’s more of an issue in documents than spreadsheets. People seem to hold Excel documents to a lower standard than those in Word, but it still nags at me when I see table headings with these annoying little errors.

So this is something I’ve been meaning to write for literally years, and only just got around to completing. You may have seen my post on subscript and superscript formatting for common things like CO2, m2, m3, H2O and so on in Word. If not, here it is.

And here’s the same thing for Excel. The macro corrects:

m2 to m2
m3 to m3
H2O, H20 to H2O
C02, CO2 to CO2
kwh, KWH, KWh to kWh
KG, Kg to kg

It works on protected worksheets in your workbook, so long as they are not password protected.

You’re welcome!

Tags: , ,

Jamie Bull | mail@oco-carbon.com

Related Posts

WiGLE is a popular platform which can be used for finding the location of a device using the names of WiFi networks in its vicinity. I’ve written about this before, and wrote some Python code to interact with their API. This API has since been retired and replaced with a new one, as of December […]

Just a quick post to point out a couple of really useful tools.The first is a web-based tool for finding weather files for a location of interest. It’s similar to the Excel EPW finder tool we created a few years back, but much more modern looking. It is however missing a few of the useful […]

Eppy is a really useful library which I’ve written about several times, since before I really had anything to offer in terms of contributing code. Over the past year or so though, I’ve started to contribute back some of the changes and additions I’ve made while using eppy on academic and commercial projects.This post is […]

3 Comments on “Excel macro for subscripts, superscripts and common typos”

Leave a Reply

Your email address will not be published. Required fields are marked *