Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
roee1983
Contributor III
Contributor III

Export to Excel 3 Tables into One Sheet

Hi all,

I have these 3 different tables Pivot tables.

I want to create an option(I think it will be with a macro)  to export them to excel file to one sheet with a space of a line

any suggestions?

Thanks

Roee

1 Solution

Accepted Solutions
5 Replies
ashwanin
Specialist
Specialist

ashwanin
Specialist
Specialist

ashfaq_haseeb
Champion III
Champion III

Anonymous
Not applicable

Hi

try the below macro

just change TB05 and TB04 to your TableBox ID's or any Chart ID's also if you want to add just add it with "," and chartid with "

sub new_to_Export

Set Obj_XLApp = CreateObject ("Excel.Application")

Obj_XLApp.Visible = true

Obj_XLApp.DisplayAlerts = true

set Obj_XLTemplate = Obj_XLApp.Workbooks.Add

Obj_XLTemplate.worksheets ("sheet1").range ("A1").select

Obj_XLTemplate.worksheets ("sheet1").range ("A1").value="Title............."

for each  chartID in array("TB05","TB04")  'change them accordingly to your chat ID's'

  lastrow=Obj_XLTemplate.worksheets ("sheet1").Range ("A65536").End (-4162).Row

  Set objSource = ActiveDocument.GetSheetObject (chartID)

  Obj_XLApp.cutcopymode = false

  Call objSource.CopyTableToClipboard (True)

  Obj_XLTemplate.worksheets ("sheet1").range ("A"& lastrow + 2).select

  Obj_XLTemplate.worksheets ("sheet1").paste

next

end sub

Regards

Harsha

roee1983
Contributor III
Contributor III
Author

Thank u all