Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
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??

1 Solution

Accepted Solutions
vikasmahajan

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

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.
tresesco
MVP
MVP

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 !!