Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have written a macro to export tables to a single sheet and it works fine. But I want to delete few specific rows and cells in the exported excel. How do I define it in a macro staticly?
what ever fields are not required can be de selected and can run the macro...
I know this is an old thread but for me it was as simple as using
XLSheet1.Columns("A:E").Delete
in my macro VBA in Qlikview to remove those columns
eg - extracting a table to excel, formatting and removing some columns
sub test1
SET XLApp = CreateObject("Excel.Application")
XLApp.Visible = true
SET XLDoc = XLApp.Workbooks.Add
SET XLSheet1 = XLDoc.Worksheets(1)
'Table export
ActiveDocument.GetSheetObject("CH77").CopyTableToClipboard (true)
XLSheet1.Paste XLSheet1.Range("A1")
XLSheet1.Name = "E200 - Salary"
'AutoFit All Columns on Worksheet
XLSheet1.Columns("H:H").ColumnWidth = 80
XLSheet1.Columns("G:G").ColumnWidth = 80
XLSheet1.Columns("A:E").Delete
XLSheet1.Range("E1").Activate
XLSheet1.Range("A1").Select
XLSheet1.Cells.Select
XLSheet1.Cells.EntireColumn.AutoFit
XLSheet1.Cells.EntireRow.AutoFit
XLSheet1.Columns("E:E").Select
XLSheet1.Columns("E:E").Style = "Comma"
XLSheet1.Range("A1").Select
end sub