Scripting Blog [archived]

Formerly known as the "Hey, Scripting Guy!" blog

Hey, Scripting Guy! How Can I Change the Color of a Spreadsheet Cell Based on a Range of Values?

(image) Hey, Scripting Guy! I need a script that can read all the values in a spreadsheet and then change the background colors of the cells in that spreadsheet based on a range of values. For example, if the value is less than 20 the cell gets colored one color; if the cell is between 20 and 40 it gets colored another color; and so on. How ...

Hey, Scripting Guy! How Can I Search For Values in an Excel Worksheet?

(image) Hey, Scripting Guy! How can I use Excel’s Find method to search for values within a worksheet?-- SK(image) (image) (image) Hey, SK. Before we begin today, we have a question for you, and for everyone else out there in Scripting Land. Back when the Scripting Guys first started planning the 2008 Winter Scripting Games (February ...

Hey, Scripting Guy! How Can I Cut a Row From One Office Excel Spreadsheet and Paste That Row Into Another Spreadsheet?

(image) Hey, Scripting Guy! How can I cut a row from an Office Excel spreadsheet and paste it into the first unused row in another Excel spreadsheet?-- NC(image) (image) (image) Hey, NC. We apologize if today’s column feels a little damp; as it turns out, those of us in the Seattle area are experiencing another one of the Puget Sound’s...

Hey, Scripting Guy! How Can I Convert a Number to a Date and Then Back in Excel?

(image) Hey, Scripting Guy! We have a spreadsheet that includes numbers like this: 31738. However, this isn’t supposed to be a number, it’s actually supposed to be a date: 11/22/1986. How can I convert these numbers to dates and then, if needed, convert those dates back to numbers?-- TC(image) (image) (image) Hey, TC. Yes, as a matter ...

Hey, Scripting Guy! How Can I Insert New Rows Above the Last Row in an Office Excel Spreadsheet?

(image) Hey, Scripting Guy! I have an Office Excel spreadsheet in which the last row in the spreadsheet sums all the rows above it. How can I add new rows (and new data) to this spreadsheet, making sure that the last row always sums up all the rows above it?-- AW(image) (image) (image) Hey, AW. By the way, please excuse the mess; at the ...