Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Andrius45
Contributor III
Contributor III

How to export into separate sheets?

Hey all,

So I have a macro which helps me to automatically export certain tables to excell sheet. Right now they are all exported to one sheet, is it possible to edit macro to make separate sheet for separate table?

!

Set curWorkBook = excelFile.WorkBooks.Add   'Create the WorkBook

     Set curSheet = curWorkBook.WorkSheets(1)      'Create the Sheet

     vArray = ActiveDocument.GetVariable("v_recipient_report").GetContent.String   'Get Report Number

     chartArray =split(vArray, ",") 

     usedRows=0

     For Each chart In chartArray

     Set l = ActiveDocument.GetSheetObject(chart)

     chartCaption = l.GetCaption.Name.v

     curSheet.Cells(usedRows+1, 1)=chartCaption

     l.CopyTableToClipboard true

     curSheet.Cells(usedRows+3, 1).Select

     curSheet.Paste 

     usedRows=curSheet.UsedRange.Rows.Count+3 '--->function to get the first unused row

     Next 'loop end

0 Replies