Hi. Not really sure how to go about this.
I have a master table that I constantly update. I download another list with the current status and dates of the received items.
Column C may already contain data that I do not want overwritten.
Column H will enter the status under Column C and Column D, if Column G finds a match with Column A. If no match found in A, then it will move onto the next item, but should not overwrite anything if there is no match.
=IFERROR(INDEX($g$2:$h$16, MATCH(A2,$h$2:$h$500,0)),cell) returns #name? error
How do I set the range to last found line, instead of $h$500?
I hope I explained it clearly enough. I am fairly new to this so not sure how to go about doing this update.
I tried many codes I found on the internet and it always returned some error.
I tried a match code as well.
This code in the spreadsheet is the latest one I've tried.
I also found this one, which I do not quite understand how to integrate this:
------------------------------------------------------------------
[code]
Dim fpath As String
Dim owb As Workbook
Dim Master As Worksheet
Dim Slave As Worksheet 'the following declares both master and slave as worksheets
fpath = "location of master workbook"
Set owb = Application.Workbooks.Open(fpath) 'opens the file path
Set Master = ThisWorkbook.Worksheets("name of sheet in child workbook") 'declares this workbook and sheet as "master"
Set Slave = owb.Worksheets("name of sheet in master you are pasting to") 'declares the workbook and sheet you're copying to as "slave"
For j = 1 To 2000 '(the master sheet) 'goes through each row from 1 to 2000
For i = 1 To 2000 '(the slave sheet) 'again does the same and the slave sheet
If Trim(Master.Cells(j, 4).Value2) = vbNullString Then Exit For 'if the ID is blank it will exit and move on to the next row
If Master.Cells(j, 4).Value = Slave.Cells(i, 4).Value Then 'the 4 represents column D, if cell in column D matches the cell in column D in the masterwork book then it will..
Slave.Cells(i, 1).Value = Master.Cells(j, 1).Value 'cell in column A child workbook equals cell in column A in master workbook
Slave.Cells(i, 2).Value = Master.Cells(j, 2).Value
Slave.Cells(i, 3).Value = Master.Cells(j, 3).Value 'same for B and C
End If
Next
Next
MsgBox ("Data Transfer Successful")
With owb
.Save
.Close
End With
[code]
Bookmarks