excel中同一工作薄不同工作表的同一位置汇总
1、首先要知道Excel 或者WPS中有VBA这个功能
2、然后复制这个代码,我这里灵活的写的是将表格的最后一行数据汇总到汇总表里
3、Private Sub Worksheet_Activate()D坡纠课柩im a, b, c, d, e, ar(), br(), sh As Worksheetd = Sheet1.Cells(Rows.Count, 1).End(xlUp).RowIf d <> 1 Then Sheet1.Range(Cells(2, 1), Cells(d, 40)).ClearContentsEnd Ifar = Sheet1.Range(Cells(1, 1), Cells(Sheets.Count, 40))a = 2For Each sh In Sheets ' If sh.Name <> "汇总" Then ar(a, 1) = sh.Name c = sh.Cells(Rows.Count, 1).End(xlUp).Row For b = 1 To 39 ar(a, b + 1) = sh.Cells(c, b) Next a = a + 1 End IfNextSheet1.[a1].Resize(UBound(ar), UBound(ar, 2)) = arEnd Su
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:52
阅读量:49
阅读量:41
阅读量:69
阅读量:37