During execution of macro I reads multiple excel file and creates a new excel file, i build a similar sheet:
At runtime by VBA I want to set this area and create a table, add Total Row and get the following result:
Thank you :-)
Like this:
Range("A1:I9").Select
ActiveSheet.ListObjects.Add(xlSrcRange, Range("$A$1:$I$9"), , xlYes).Name = "Table1"
ActiveSheet.ListObjects("Table1").ShowTotals = True
ActiveSheet.ListObjects("Table1").ListColumns("B").TotalsCalculation = xlTotalsCalculationSum
ActiveSheet.ListObjects("Table1").ListColumns("C").TotalsCalculation = xlTotalsCalculationSum
'Repeat row above until column I
I got this by recording a VBA Macro. If you are not familiar with Macro recording see link here .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.