<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic export pivot table to Excel macro to remove cell merging VB in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/export-pivot-table-to-Excel-macro-to-remove-cell-merging-VB/m-p/709278#M255570</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Forum!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calling all VB experts. I have an issue when exporting a pivot table out of QV with a macro.&lt;/P&gt;&lt;P&gt;dimension cells in pivot merge which is unwanted, and secondly i am looking to enhancing my macro with a macro to remove merged cells but it is not working so well. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have the following code in an excel macro, but can this be incorporated in my vb macro in Qlikview?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Flattening the Pivot Table&lt;/P&gt;&lt;P&gt; sub Format&lt;/P&gt;&lt;P&gt;With Range("B2:B" &amp;amp; Cells(Rows.Count, "A").End(xlUp).Row)&lt;/P&gt;&lt;P&gt;.MergeCells = False&lt;/P&gt;&lt;P&gt;With .SpecialCells(xlCellTypeBlanks)&lt;/P&gt;&lt;P&gt;.Value = .Value&lt;/P&gt;&lt;P&gt;.FormulaR1C1 = "=R[-1]C"&lt;/P&gt;&lt;P&gt;End With&lt;/P&gt;&lt;P&gt;End With&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Export the Chart (Macro in Qlikview)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub xport2xl()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;iRow =1&lt;/P&gt;&lt;P&gt;set xlApp = CreateObject("Excel.Application")&lt;/P&gt;&lt;P&gt;xlApp.Visible = True&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set xlWB = xlApp.Workbooks.Add&lt;/P&gt;&lt;P&gt;set xlSheet = xlWB.Worksheets(1)&lt;/P&gt;&lt;P&gt;set obj = ActiveDocument.getsheetobject(ChartName)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;xlSheet.Activate&lt;/P&gt;&lt;P&gt;xlSheet.Cells.Clear&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set txt = ActiveDocument.GetSheetObject("CH761")&lt;/P&gt;&lt;P&gt;txt.CopytableToClipboard TRUE&lt;/P&gt;&lt;P&gt;xlSheet.Cells(iRow,1).Select&lt;/P&gt;&lt;P&gt;xlSheet.Paste&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while not (isempty(xlSheet.Cells(iRow,1)))&lt;/P&gt;&lt;P&gt;iRow = iRow+2&lt;/P&gt;&lt;P&gt;wend&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set txt1 = ActiveDocument.GetSheetObject("CH759")&lt;/P&gt;&lt;P&gt;txt1.CopytableToClipboard TRUE&lt;/P&gt;&lt;P&gt;xlSheet.Cells(iRow,1).Select&lt;/P&gt;&lt;P&gt;xlSheet.Paste&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;----------------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result without Flattening (Merged Cell - Div Name)&lt;/P&gt;&lt;P&gt;&lt;IMG alt="merged.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/62721_merged.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result with Flattening (Unmerged cell - DIV NAME)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Unmerged.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/62701_Unmerged.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 19 Jul 2014 13:07:08 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-07-19T13:07:08Z</dc:date>
    <item>
      <title>export pivot table to Excel macro to remove cell merging VB</title>
      <link>https://community.qlik.com/t5/QlikView/export-pivot-table-to-Excel-macro-to-remove-cell-merging-VB/m-p/709278#M255570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Forum!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calling all VB experts. I have an issue when exporting a pivot table out of QV with a macro.&lt;/P&gt;&lt;P&gt;dimension cells in pivot merge which is unwanted, and secondly i am looking to enhancing my macro with a macro to remove merged cells but it is not working so well. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have the following code in an excel macro, but can this be incorporated in my vb macro in Qlikview?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Flattening the Pivot Table&lt;/P&gt;&lt;P&gt; sub Format&lt;/P&gt;&lt;P&gt;With Range("B2:B" &amp;amp; Cells(Rows.Count, "A").End(xlUp).Row)&lt;/P&gt;&lt;P&gt;.MergeCells = False&lt;/P&gt;&lt;P&gt;With .SpecialCells(xlCellTypeBlanks)&lt;/P&gt;&lt;P&gt;.Value = .Value&lt;/P&gt;&lt;P&gt;.FormulaR1C1 = "=R[-1]C"&lt;/P&gt;&lt;P&gt;End With&lt;/P&gt;&lt;P&gt;End With&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Export the Chart (Macro in Qlikview)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub xport2xl()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;iRow =1&lt;/P&gt;&lt;P&gt;set xlApp = CreateObject("Excel.Application")&lt;/P&gt;&lt;P&gt;xlApp.Visible = True&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set xlWB = xlApp.Workbooks.Add&lt;/P&gt;&lt;P&gt;set xlSheet = xlWB.Worksheets(1)&lt;/P&gt;&lt;P&gt;set obj = ActiveDocument.getsheetobject(ChartName)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;xlSheet.Activate&lt;/P&gt;&lt;P&gt;xlSheet.Cells.Clear&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set txt = ActiveDocument.GetSheetObject("CH761")&lt;/P&gt;&lt;P&gt;txt.CopytableToClipboard TRUE&lt;/P&gt;&lt;P&gt;xlSheet.Cells(iRow,1).Select&lt;/P&gt;&lt;P&gt;xlSheet.Paste&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while not (isempty(xlSheet.Cells(iRow,1)))&lt;/P&gt;&lt;P&gt;iRow = iRow+2&lt;/P&gt;&lt;P&gt;wend&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set txt1 = ActiveDocument.GetSheetObject("CH759")&lt;/P&gt;&lt;P&gt;txt1.CopytableToClipboard TRUE&lt;/P&gt;&lt;P&gt;xlSheet.Cells(iRow,1).Select&lt;/P&gt;&lt;P&gt;xlSheet.Paste&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;----------------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result without Flattening (Merged Cell - Div Name)&lt;/P&gt;&lt;P&gt;&lt;IMG alt="merged.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/62721_merged.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result with Flattening (Unmerged cell - DIV NAME)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Unmerged.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/62701_Unmerged.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Jul 2014 13:07:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/export-pivot-table-to-Excel-macro-to-remove-cell-merging-VB/m-p/709278#M255570</guid>
      <dc:creator />
      <dc:date>2014-07-19T13:07:08Z</dc:date>
    </item>
  </channel>
</rss>

