多表汇总目录指引

VBA | 2015-12-23 20:33:04 | 阅读 1371 次 | 评论(0)
Set rng = Sheets("洗沫汇总表").Range("a1:e50")
rng.Select
Selection.Clear



 Sheets("洗沫汇总表").Cells(1, 1) = "部门"
     Sheets("洗沫汇总表").Cells(1, 2) = "金质"
     Sheets("洗沫汇总表").Cells(1, 3) = "金重"
     Sheets("洗沫汇总表").Cells(1, 4) = "报表编号"
     Sheets("洗沫汇总表").Cells(1, 5) = "表名"
   
         ii = 1
    
  For i = 1 To Sheets.Count
     ii = ii + 1
    If Sheets(i).Name = "洗沫汇总表" Then  '奔瑍猨蹲羆
        ii = ii - 1
    Else
      Sheets("洗沫汇总表").Cells(ii, 1) = Sheets(i).Cells(3, 2)

      Sheets("洗沫汇总表").Cells(ii, 2) = Sheets(i).Cells(5, 3)
    
         For j = 15 To 22
             If Sheets(i).Cells(j, 1) = "合计" Then
              Sheets("洗沫汇总表").Cells(ii, 3) = Sheets(i).Cells(j, 6).Value
             End If
         Next
     
      Sheets("洗沫汇总表").Cells(ii, 4) = Sheets(i).Cells(3, 8)
      
      Sheets("洗沫汇总表").Cells(ii, 5) = Sheets(i).Name

    End If
  Next
   
End Sub
					
				
					
				
文章评论,共0条
游客请输入验证码
浏览176328次
最新评论
  • zhouwenyuan:博主可以开发房产APP吗?
  • qunxingw:结合附件,在分表A或B...实验一下宏就理解了
  • qunxingw:这仅是小范围的一种思路,此题是指数级的数据。