Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
Thank u all