Scripting Blog [archived]

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

How Can I Change the Background Color of a Cell Depending on the Date?

(image) Hey, Scripting Guy! I have a Microsoft Excel spreadsheet I periodically analyze using a script. How can I change the color of a cell to red if the date stored in that cell has passed?-- DM(image) (image) (image) Hey, DM. We were going to start today’s column off with some clever and witty remark about red-letter dates, but we ...

How Can I Delete Data from a Spreadsheet Yet Keep All the Formatting?

(image) Hey, Scripting Guy! How can I delete data from a spreadsheet yet keep all the formatting?-- TB(image) (image) (image) Hey, TB. From your email it sounds like you have a script that periodically replaces data in a spreadsheet with new, up-to-date values. The spreadsheet has been preformatted, and what you’d like to do is delete ...

How Can I Open an Excel Workbook and Retrieve the Names of All the Worksheets?

(image) Hey, Scripting Guy! How can I open an Excel workbook and retrieve the names of all the worksheets?-- JG(image) (image) (image) Hey, JG. It’s the first day back after a three-day weekend, and this morning all the Scripting Guys stumbled into the office and just stared blankly into space. (All in all, pretty much business as usual...

How Can I Tell if an Excel Workbook is Open and, If It Isn’t, Open It?

(image) Hey, Scripting Guy! How can I tell if a specific Excel workbook is open and, if it isn’t, open it?-- RK(image) (image) (image) Hey, RK. Every now and then we see a question and think, “We should answer this one; it’s so easy it won’t take more than a few minutes to finish the column and then we can all take a nice long ...