Scripting Blog [archived]

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

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 ...

Hey, Scripting Guy! How Can I Copy Data from Excel to PowerPoint?

(image) Hey, Scripting Guy! As part of a demonstration I do on a regular basis, I’d like to be able to open an Excel spreadsheet, copy all the information on Sheet 1, and then paste that data into a new PowerPoint slide. How can I do all that using a script?-- JG(image) (image) (image) Hey, JG. You know, the Hey, Scripting Guy! column is...

Hey, Scripting Guy! How Can I Retrieve Hyperlink Information From an Office Excel Spreadsheet?

(image) Hey, Scripting Guy! I have an Office Excel document that includes a hyperlink linked to an email address. The text in the spreadsheet simply says Yes. How can I write a script that retrieves the underlying email address?-- AK(image) (image) (image) Hey, AK. You’ll have to forgive us for being a little distracted today. Today is ...

Hey, Scripting Guy! How Can I Insert Blank Rows (and Formulas) Into an Office Excel Worksheet?

(image) Hey, Scripting Guy! I have some extremely large Office Excel worksheets, and I need to insert a blank row every 240 lines; in that new row I then need to insert a formula that calculates the average of the preceding 240 rows. As you might expect, this is extremely tedious, and I have a lot of these worksheets. How can I write a ...