Hi guys.

I am using the current code which does what it is supposed to do within the same workbook.

Sub CrossCheck()

Dim rngSource As Range, rngTarget As Range, rng As Range
Dim lLastRow As Long, lRow As Long

With Application
.ScreenUpdating = False
End With

Set rngTarget = Sheets("MTDataList").Range("$A:$A")
Set rngSource = Sheets("VendorList").Range("$A:$A")

lLastRow = rngSource.Rows(rngSource.Rows.Count).End(xlUp).Row

For lRow = 2 To lLastRow

Set rng = rngTarget.Find(What:=rngSource.Cells(lRow), LookAt:=xlWhole)

If Not rng Is Nothing Then
With rngSource.Cells(lRow)
.EntireRow.Interior.ColorIndex = 6
End With
End If

Next lRow

With Application
.ScreenUpdating = True
End With


End Sub


I am trying to do similar between 2 workbooks.

This is what I have so far, alas! It doesn't want to play fair.. :-)

It opens the target worbook on the required sheet using ("", dCell).Activate but that's all it does.

I can't seem to get the code structure right in order to Find the Matching value between the workbooks where I need the Offset value to be copied across.

As always, any assistance is greatly appreciated

Sub Import_Preloads()

Dim rngSource As Range, rngTarget As Range, rng As Range
Dim lLastRow As Long, lRow As Long

Dim Swb As Workbook
Dim Twb As Workbook
Dim dCell As Range

Set Swb = Workbooks("SchedMasterTest.xls")

Set dCell = [X1] 'Constenatated Month Year ( eg Apr 2015)

With Application
.ScreenUpdating = False
End With

On Error Resume Next
Set Twb = Workbooks("Preload Sched.xls")
On Error GoTo 0

If Twb Is Nothing Then
SetAttr "T:\Vic\Scheduler\Preload Sched.xls", vbNormal
Set Twb = Workbooks.Open("T:\Vic\Scheduler\Preload Sched.xls")
End If


On Error Resume Next

If Not dCell.Value Is Nothing Then Twb.Sheets("" & dCell).Activate

On Error GoTo 0

On Error Resume Next
Windows("SchedMasterTest.xls").Activate
On Error GoTo 0

Set rngTarget = Twb.Sheets("" & dCell).Range("$B:$B")
Set rngSource = Swb.Sheets("Master").Range("$B:$B")

lLastRow = rngSource.Rows(rngSource.Rows.Count).End(xlUp).Row

For lRow = 5 To lastrow

Set rng = rngTarget.Find(What:=rngSource.Cells(lRow), LookAt:=xlWhole)

If Not rng Is Nothing Then
With rngSource.Cells(lRow)
.Offset(0, 10).Value = rng.Offset(0, 10).Value
End With
End If

Next lRow

With Application
.ScreenUpdating = True
End With

End Sub