Hi one more help
I trying to do the file copy process by according to column value (directory path) i.e cSorcDir = A column and cdestdir = B column. And below is the code which i tried but it didn't works - please help me on this too
Sub compare()
Dim ofso As Object
Dim ofile As Object
For i = 1 To 2
Const cSorcDir As String = Sheets(Sheet1).Range("A", i)
Const cdestdir As String = Sheets(Sheet1).Range("B", i)
nwpt = cSorcDir
ngpt = cdestdir
Call ScanFolder(nwpt, ngpt)
Next
End Sub
Function ScanFolder(cSorcDir, cdestdir)
Set ofso = CreateObject("Scripting.FileSystemObject")
For Each ofile In ofso.GetFolder(cSorcDir).Files
If Len(Dir$(cdestdir & ofile.Name)) = 0 Then
MsgBox ofile, , "File Missing"
FileCopy ofile, cdestdir & ofile.Name
End If
Next
End Function
Thanks
Thiru
Bookmarks