@Mumps
As you helped for the same thing before kindly look into the files attached again
I just basically wants to update the data by matching its order numbers
-Uploading the data from browser and pasting it Masterfile attached below by button name "Upload POD"
- As both the workbooks have a same column name "Order number" so while pasting it should be pasted into the respective row where that "Order number" in the master file is location
-As for example In Masterfile C5 has Order number of "9207116092" so when uploading the document having Proof data occurs the value mentioned in Order number of "9207116092" in file Purchase should be paste corresponding row5 in Proof of delivery date" columnF , the value against order number 9207116092 is 3rd Jan
copying data from Purchase file, as an example Order number "9207116092" so it should search in Masterfile and paste the Proof of delivery date in COlumnG ("3rd Jan") for this example, in the row where Order number ""9207116092"" is located or Found i.e in C5
I have to extract data from file POD this time and get the POD dates respectively with their matched order number values already in Masterfile
Note: Every row will have a different order number, so not really any chances of over-driven data
Sub uploadPODdata()
Dim WScopy As Worksheet, WSdest As Worksheet, desWB As Workbook, FileToOpen As Variant, cRow As Long, lastRow As Long, fnd As Range, PO As Range
Set desWB = ThisWorkbook
Set WSdest = desWB.Sheets(1)
Application.ScreenUpdating = False
FileToOpen = Application.GetOpenFilename(Title:="Browse for your file & Import Range", FileFilter:="Excel Files (*.xls*),*xls*")
If FileToOpen = False Then Exit Sub
Set OpenBook = Application.Workbooks.Open(FileToOpen)
With Sheets(1)
cRow = .Cells(Rows.Count, "C").End(xlUp).row
For Each PO In Range("C5:C" & cRow)
Set fnd = WSdest.Range("G:G").Find(PO, LookIn:=xlValues, lookat:=xlWhole)
If Not fnd Is Nothing Then
fnd.Offset(, 1) = PO.Offset(, 1)
End If
Next PO
End With
With WSdest
cRow = .Cells(.Rows.Count, "A").End(xlUp).row
.Range("N4:N" & cRow).Formula = "=if(E4=F4,M4*1,M4*0)"
End With
ActiveWorkbook.Close False
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
Display More