Macro to export all sheets in a Mac Excel file to CSVs

I found the below code and it is a life saver. Saves time too! No more spending hours with the hated Microsoft ‘Are you sure you want to do what you want to do?’ dialogue box loop. Grrrrrr.

Enjoy.

Sub AllSheetsToCSV()
For Each s In Sheets
s.Activate
ActiveWorkbook.SaveAs Filename:=s.Name, FileFormat:=xlCSV
Next s
End Sub

To use: Open VBA editor. Create new module. Paste code into module. Hit play.

And it does just work. Many thanks to ‘pompomtom’ who posted it in ask.metafilter.com

Original link posted by pompomtom at 5:01 PM on July 22, 2013 in ask.metafilter.com

An example of Tower Hamlet’s council’s approach to Open Government

Real life is always stranger than fiction.

Today I finally managed to get myself to sunny Shoreditch for an Open Data Institute lunchtime lecture.

This Friday the talk was “How can local government deliver better services with fewer resources using data?” given by Ben Unsworth of Socrata.

Talk was great, attendance was great, met some interesting people.

I think I may have briefly mentioned that the possibility of Tower Hamlet’s council in any way embracing the notion of Open Data let alone Open Government were approximately zero.

And I may have outlined my strategy which is ‘guerilla open data’ and is in the fine traditions of the Open Data movement. Use the law to rip Open Data from the hands of those who want to keep it Closed Data and publish it for everyone to see.

After buying a new mouse I returned home to sunny Wapping and the first tweet I saw when checking my timeline was this:

Ted Jeory@TedJeory Tower Hamlets council’s new commitment to transparency in action (scroll through the document) modgov.towerhamlets.gov.uk/documents/g541… >>must be the date”

Click on the link to that PDF document.

Page one is grandly titled ‘MAYOR’S EXECUTIVE DECISION MAKING’, Mayor’s Decision Log No.62. The subject is ‘POPLAR BATHS & DAME COLET HOUSE – FINANCIAL CLOSE’ and there are 38 pages in all.

Popcorn ready? Sitting comfortably? Here’s a precis of the document if you couldn’t be bothered to click on the link.

  • This page is intentionally left blank
  • Agenda Item 1. By virtue of paragraph(s) 3 of Part 1 of Schedule 12A of the Local Government Act 1972. Document is Restricted
  • This page is intentionally left blank
  • Document is Restricted
  • This page is intentionally left blank
  • Document is Restricted
  • This page is intentionally left blank
  • Document is Restricted
  • This page is intentionally left blank
  • Document is Restricted
  • This page is intentionally left blank
  • Document is Restricted
  • This page is intentionally left blank

See the pattern here? 38 pages of whiteness that a polar bear would feel at home in.

And that ladies and gentlemen of the Open Data and Open Government communities is what Tower Hamlet’s council thinks of you.

But don’t worry, it treats residents of our great borough with even more contempt.

Note: I should emphasise that the document was discovered by @TedJeory, not me. Well done Ted. Will there be a sequel?