代码如下:
Sub 生成工作簿()
t = "d:/" '保存路径
For i = 1 To [a65536].End(xlUp).Row
Set newbook = Workbooks.Add '建立一个新的工作簿
With newbook '设置属性
.SaveAs Filename:=t & Cells(i, 1) & ".xls"
.Close
End With
Next
End Sub
是要生成空白的excel文件吗?
dim str as string
dim i ,j as long
j=Application.WorksheetFunction.CountA(Range("A:A")) 'A列总共的个数
for i = 1 to j
str=worksheets("sheet1").cells(i,1)
Workbooks.Add
ActiveWorkbook.SaveAs _
Filename:"c:\“&str&”.xls", _
FileFormat:=xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False
next
如果是自动打开可以用超级链接