So you're all familiar with the run of the mill functions in Excel, yes? You know the type: SUM(A2:C4) where it will total up the sum of all the numbers in the area from A2 to C4. Well these are good and useful, however, I built a pretty large spreadsheet on GoogleDocs for work. It's used for inventory, inter-store ordering and to make my life generally easier in keeping track of the profitability of each location.

Well, a problem arose as I implemented them--I couldn't just make several forms ahead of time for each month for each store. Regrettably, the items and prices will change over time and so the easiest thing to do is to copy the prior month's form at the start of a new month and clear all the entries.

Drop Down Menu!

Confused yet? None of that really matters. The point is, I needed a quick way to clear a million varying ranges on several tabs of each spreadsheet. Enter: GoogleScripts. That's right, you can write Java behind the scenes and have it execute. Well, I've been learning Python, but it only took a little research to figure out the proper way to make the clear functions. As an added bonus, I figured out how to create an additional Drop Down Menu to access the functions.

My first real-life application of programming. :)


A bit of the code. The rest is just more of the same clear function with different ranges for the different sheets.

Copyright © 2016, Eamonn Cottrell. All Rights Reserved