so i have this program it does copy a file from path to path but when the does already exist it overwrite the original one, what im trying to do it when it already exist just copy the necssary lines that changed in the excel file.
thank you in advance
this is my program
Sub Copy_Certain_Files_In_Folder()
Dim FSO As Object
Dim FromPath As String
Dim ToPath As String
Dim FileExt As String
FromPath = "N:\1300\1310\BOM"
ToPath = "S:\Bills of Materials - Shipping & Receiving\1400s"
FileExt = "*.xlsx*"
If Right(FromPath, 1) <> "\" Then
FromPath = FromPath & "\"
End If
Set FSO = CreateObject("scripting.filesystemobject")
If FSO.FolderExists(FromPath) = False Then
MsgBox FromPath & " doesn't exist"
Exit Sub
End If
If FSO.FolderExists(ToPath) = False Then
MsgBox ToPath & " doesn't exist"
Exit Sub
End If
FSO.CopyFile Source:=FromPath & FileExt, Destination:=ToPath
MsgBox "You can find the files from " & FromPath & " in " & ToPath
End Sub
Bookmarks