右键sheel表
查看代码
图片.png出现这个
图片.pngSub xcopy()
Dim xpath1 As String, xpath2 As String, xfile As String
xpath1 = "G:\E_chi-GENOME\11-orthofinder\Results_Dec16\Orthogroup_Sequences\"#母文件夹
xpath2 = "C:\Users\Administrator\Desktop\Meloidae-specificOG\"#子文件夹
For i = 1 To 150 #150指的是文件名个数
If Cells(i, 1) <> "" Then
xfile = xpath1 & Cells(i, 1) & ".fa"
If Dir(xfile) <> "" Then
FileCopy xfile, xpath2 & Cells(i, 1) & ".fa"
Kill xfile
Else
Cells(i, 3) = xfile & "文件找到"
End If
End If
Next
End Sub
网友评论