汇总报表中单列公司的数据要分发到下属公司,如果每一列都复制到新工作簿另存,工作很大,所以编写了一段VBA来代替重复的手工劳动
Sub add_new()
On Error Resume Next
With Worksheets("Detail line-consolidation") '汇总报表
For i = 3 To 35
Dim fname As String
fname = .Cells(3, i) '取公司名称
Dim mybook As Workbook
Set mybook = Workbooks.Add
mybook.SaveAs "d:\vba\" & fname & ".xls"
col = Split(Cells(3, i).Address, "$")(1) '取列名
.Range("a2:b169").Copy
Windows(fname & ".xls").Activate
Range("a1").PasteSpecial
.Range(col & "2:" & col & "169").Copy
Windows(fname & ".xls").Activate
Range("c1").PasteSpecial
Workbooks(fname & ".xls").Close savechanges:=True
Set mybook = Nothing
Next i
End With
End Sub
Pingback: EXCEL VBA笔记(不断更新中) | 津津有味Jjuv Blog
Maybe windows installed in your house are not as good Sweden but the one I have installed are. ,
safe reliable canadian pharmacy
https://expresscanadapharm.shop/# Express Canada Pharm
safe reliable canadian pharmacy
Always up-to-date with international medical advancements.
where can i buy cheap cipro no prescription
Always a pleasant experience at this pharmacy.
Their international health campaigns are revolutionary.
where can i get cipro without rx
Their global health insights are enlightening.
They source globally to provide the best care locally.
gabapentin pictures 300mg
Their international insights have benefited me greatly.
Their wellness workshops have been super beneficial.
cost of generic cipro pills
Their vaccination services are quick and easy.