Add a Button To Automate Add a Column with Date for Inventory

Learn how to create a button in Google Sheets that automatically adds a new column with the current date as the header, streamlining your inventory management process.

We wanna create a button that automatically adds a column with the date as the header . We can do this ourselves, right? We can just go over to the right side control, right click whatever we wanna do, insert column to the right. We can even copy and paste this formatting or just write three eight here. But what if we could do this with a single click of a button? Let's do that. What we're gonna do is. Insert a drawing first. A shape like this, call it add column. We can change the color if we want, maybe yellow, and we can click it and bring it all the way over to the left side and just have this right over here. Then we're gonna go to extensions app script . Once this opens, it looks like function , my function . We'll call this add column with date. We need spreadsheet , app.gi Add Columns Automatically How To Add Columns in Google Sheets Add Columns Automatically Button Styles

active sheet insert. Column after, and now we need to know how many columns we have and then plus one. But how do we get the columns? We do variable columns equals spreadsheet . App. Do get active spreadsheet or sheet. Get last column and now we want to insert the date. That'll be spreadsheet app. Get active sheet dot get range . The range is row one. And in columns plus one. Again, set value, new date with capital D and parentheses after the date. And also close parentheses around set value. We're gonna save this. We can run this from here to see if we have any errors. Probably don't want to do plus one here. We just want to insert after that last column, save it, run it again, Add Columns Automatically How To Add Columns in Google Sheets Add Columns Automatically How to Add Multiple Columns with Apps Script

and we have our date is inserted here, so how do we get it to this button? Make sure we copy the function name, add column with date. Click on this image , and over on the top right there's three dots. Click those, assign script and paste just the name of the function . Click okay. And now every time I click that, we're gonna insert a new column and add that date right there. Makes your sheet so much easier to work with, right each and every day. If you're looking for more automations like this. And you wanna get more out of your Google sheets, subscribe right now to better sheets right here on YouTube. How to Insert Multiple Rows in Google Sheets (Easy to Hard) How To Add Columns in Google Sheets Copy Date to Next Cell Automatically Button Styles