Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
Not applicable

Excel Export Formatting Issue

Hi

This is how my qlikview chart(straight table) looks like.

issue1.jpg

I am writing a MACRO to transpose and export to excel.This is the code :issue2.jpg

So i get the following output on button click event :

Issue.jpg

But the Expressions label alignment is centre.But in the Qlikview Straight table in the fig1 its left aligned.

All the data are properly populated with the correct format except for the expressions label.

Any idea on how to solve this alignment issue??

Tags (1)
1 Solution

Accepted Solutions
vikasmahajan
Esteemed Contributor

Re: Excel Export Formatting Issue

Add following code and check

'********* Format Excel **************

    Set Selection = XLSheet.Cells

  With Selection

  .VerticalAlignment = 1

  .WrapText = True

  .Borders.ColorIndex = 0

  .ColumnWidth = 11

  'When the export finishes we display the below message:

  'MSGBOX "Export Complete!",VbInformation

  End With

Hope this helps you.

Vikas

View solution in original post

4 Replies
vikasmahajan
Esteemed Contributor

Re: Excel Export Formatting Issue

Add following code and check

'********* Format Excel **************

    Set Selection = XLSheet.Cells

  With Selection

  .VerticalAlignment = 1

  .WrapText = True

  .Borders.ColorIndex = 0

  .ColumnWidth = 11

  'When the export finishes we display the below message:

  'MSGBOX "Export Complete!",VbInformation

  End With

Hope this helps you.

Vikas

View solution in original post

MVP
MVP

Re: Excel Export Formatting Issue

See if this helps:

Columns("A:A").Select

    With Selection

       .HorizontalAlignment = xlLeft

        .VerticalAlignment = xlBottom

        .WrapText = False

        .Orientation = 0

        .AddIndent = False

        .IndentLevel = 0

        .ShrinkToFit = False

        .ReadingOrder = xlContext

        .MergeCells = False

    End With

Modify accordingly.

Not applicable

Re: Excel Export Formatting Issue

Hey Vikas,

Thanks Yaar it helped.

But any idea how to Autofit row/Column based on the data??

Not applicable

Re: Excel Export Formatting Issue

Thanks tresesco.It worked !!