示例工作簿链接: http: //www.wikisend.com/download/245286/MIS%20-%20July%20%20 (1).xlsm
该工作簿具有 vba 代码,该代码删除所有工作表,然后通过从其他工作簿复制工作表来创建新工作表。
我想要另一个 vba 代码自动生成包含所有格式和数据的执行摘要表。一些公式定义不明确,因此以后必须手动编辑它们。由于其他工作表每个月都会更改,因此手动引用会很乏味
我当前的代码:
Sub WorksheetLoop()
Sheets.Add After:=Sheets(Sheets.Count)
Sheets(Sheets.Count).Select
Sheets(Sheets.Count).Name = "Executive Summary"
Sheets("Executive Summary").Select
'Some formatting code on sheet Executive Summary
Dim ws As Worksheet
' Begin the loop.
currentRow=6 'start entering data from row 6
For Each ws In ThisWorkbook.Worksheets
'Assign cell at row=current row and col B reference to cell G5 at sheet ws
'Assign cell at row=current row and col F reference to cell J15 at sheet ws
'Assign cell at row=current row and col H reference to cell T5 at sheet ws
'increment Current row by 1
'don't know what to do here
Next ws
'select entire region( all filled cells)
'format text, add border etc
End Sub
请告诉我引用的语法