Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Now accepting applications for the Qlik Luminary and Partner Ambassador Programs: Apply by July 6!
cancel
Showing results for 
Search instead for 
Did you mean: 
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??

Labels (1)
1 Solution

Accepted Solutions
vikasmahajan
MVP
MVP

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

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.

View solution in original post

4 Replies
vikasmahajan
MVP
MVP

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

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
tresB
Champion III
Champion III

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
Author

Hey Vikas,

Thanks Yaar it helped.

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

Not applicable
Author

Thanks tresesco.It worked !!