|
楼主 |
发表于 2016-4-9 19:51
|
显示全部楼层
baksy 发表于 2016-4-9 19:42
附件有问题
是的,我就是运行总是出错 怎么调试都不行(估计是我太水没能弄出来)
所以我上来论坛找其它大神教教 看看怎么调试才可以
代码出处是blog.sina.com.cn/s/blog_3fb57d010100l9z1.html
Sub makfile()
Dim count, url, words, rwindex, url1, fso
Set fso = CreateObject("Scripting.FileSystemObject")
count = ActiveSheet.UsedRange.Rows.count 'rows
url = "e:\wireless\"
For words = 1 To count
If Sheet1.Cells(words, 1).Value <> "" Then
url = url + Sheet1.Cells(words, 1).Value + "\"
Else
url1 = ""
wd1 = words
Do While url1 = ""
url1 = Sheet1.Cells(wd1 - 1, 1).Value
wd1 = wd1 - 1
Loop
url = url + url1 + "\"
End If
If fso.FolderExists(url) = False Then MkDir (url)
url1 = ""
If Sheet1.Cells(words, 2).Value <> "" Then
url = url + Sheet1.Cells(words, 2).Value + "\"
Else
wd1 = words
Do While url1 = ""
url1 = Sheet1.Cells(wd1 - 1, 2).Value
wd1 = wd1 - 1
Loop
url = url + url1 + "\"
End If
If fso.FolderExists(url) = False Then MkDir (url)
url = url + Sheet1.Cells(words, 3).Value
If fso.FolderExists(url) = False Then MkDir (url)
url = "e:\wireless\"
Next words
End Sub
|
|