Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

copy only selected values to excel macro

Hi everyone,

I have a listbox and I have for example 3 numbers selected and I only want to copy these numbers to excel.

my code right now is:

ActiveDocument.GetSheetObject("LB07").Restore

    ActiveDocument.GetSheetObject("LB07").CopyTableToClipboard true   

    XLSheet.Paste XLSheet.Range("B2")

    XLSheet.Cells.EntireColumn.AutoFit

    ActiveDocument.GetApplication.WaitForIdle

    ActiveDocument.ClearCache

the problem is that this code copys the whole listbox to excel but I only want the 3 selected values to be copyed. How can I do this?

regards

MT

2 Replies
Gysbert_Wassenaar

Use a table box instead of the listbox. Or use an expression aggr(MyField, MyField) for the listbox instead of the field MyField.


talk is cheap, supply exceeds demand
Not applicable
Author

ok it is a quiet good workaround but I am not really satisfied. but thanks for your help

regards,

MT