Loop find between worksheets
Just to let you know that I crack it to work on my book
Code i used was this.
Sub moveOver3()
Dim lr1 As Long, lr2 As Long
Dim sh1 As Worksheet, sh2 As Worksheet
Set sh1 = ActiveWorkbook.Sheets("Provisions")
Set sh2 = ActiveWorkbook.Sheets("Sheet1")
lr2 = sh2.Cells(Rows.Count, 2).End(xlUp).Row
For Each c In sh2.Range("B3:B" & lr2)
lr1 = sh1.Cells(Rows.Count, 6).End(xlUp).Row
If WorksheetFunction.CountIf _
(sh1.Range("F1:F" & lr1), c.Value) = 0 Then
sh1.Range("F" & lr1 + 1) = c.EntireRow.Cells(1, 2)
sh1.Range("G" & lr1 + 1) = c.EntireRow.Cells(1, 3)
sh1.Range("AB" & lr1 + 1) = c.EntireRow.Cells(1, 5)
sh1.Range("A" & lr1 + 1) = "From Last Month"
End If
Next
End Sub
So thank you very much for your help!! I really appricate it!
Carl
|