MS Excel Vba/Macro equivalent in LibreCalc or OpenOfficeCalc

Posted by ReggieCL on Super User See other posts from Super User or by ReggieCL
Published on 2013-06-25T09:38:04Z Indexed on 2013/06/25 10:23 UTC
Read the original article Hit count: 236

is there an equivalent macro/vba in libre calc that does this routine; - Read/open xls files in a path and do a batch import/copy of read sheets and merge it with the current open workbook. Here's the vba I used in MS Excel. Thanks in advance

Sub Consolidate_Sheets()
'Folder Path to read the xlsx files from

  Path = "F:\WIP2\Below 25\"
  filename = Dir(Path & "*.xlsx")

  Do While filename <> ""
    Workbooks.Open filename:=Path & filename, ReadOnly:=True

    For Each sheet In ActiveWorkbook.Sheets     
     'import/copy sheets from to read xlsx files
      sheet.Copy After:=ThisWorkbook.Sheets(1)    
    Next sheet

    Workbooks(filename).Close
    filename = Dir()
  Loop

End Sub

© Super User or respective owner

Related posts about microsoft-excel

Related posts about macros