From xradiograph

Programming: Microsoft Excel

General Notes

dumping things here to find, later.



Tips and Tricks

Excel Pasting Tricks
Splitting One Cell Row into Multiple Rows (and then columns, if that’s your thing)



Code Editing



  1. Tools >> Macro >> Visual Basic Editor
  2. Alt F11


Script Editor (???)

  1. Tools >> Macro >> Microsoft Script Editor
  2. Alt-Shift F11





Export all sheets as CSV files


Sub ExportAllSheets()

    Dim sht         As Worksheet
    Dim FName As String
    Dim Stamp As String

    Const PATH As String = "T:\ExportFileLayout\dec\"

    Stamp = "_" & Format(Now, "ddmmyyyy")

    For Each sht In Sheets
        Debug.Print sht.Name

        FName = PATH & sht.Name & ".csv"

        'TODO: trouble-spot, SaveAs changes the active name, not an export :-(
        Call sht.SaveAs(Filename:=FName, FileFormat:=xlCSV)

    Next sht

End Sub



See Also



Category tags

Programming VBA Excel

Retrieved from
Page last modified on November 13, 2014, at 09:47 AM