Hi Helmekki,
Try:
Sub AdNwExp()
Dim myRng, cel, exp As Range
Dim destCell As Range
Set exp = Sheet1.Range("B2:B52")
Set myRng = Sheet2.Range("B2:B52")
On Error GoTo XIT
For Each cel In exp.Cells
If IsEmpty(cel) Then Exit For
With Application
.ScreenUpdating = False
If IsError(.Match(cel.Value, myRng, 0)) Then
If .CountA(myRng) = 0 Then
Set destCell = myRng(1)
ElseIf .CountA(myRng) = 1 Then
Set destCell = myRng(2)
Else
Set destCell = myRng(1).End(xlDown). _
Offset(1)
End If
cel.Copy destCell
End If
End With
Next
XIT:
Application.ScreenUpdating = True
End Sub
---
Regards,
Norman
"helmekki" wrote in
message ...
Hi there
'* The code confirms that each value in sheet1 exist in sheet2.
'* I need if the code finds a new value in sheet1 to put it in sheet2
last value..............
This code is my try, but cannot perform the job needed
Code:
--------------------
Sub AdNwExp()
Dim counter As Integer
Dim myRng, cel, exp As Range
counter = 1
Do
Set exp = Sheet1.Range("B2:B50")
Set myRng = Sheet2.Range("B2:B50").Cells(counter, 1)
For Each cel In exp
If cel = myRng Then GoTo 1
Next cel
1:
counter = counter + 1
Loop Until IsEmpty(exp)
End Sub
--------------------
--
helmekki
------------------------------------------------------------------------
helmekki's Profile:
http://www.excelforum.com/member.php...fo&userid=6939
View this thread: http://www.excelforum.com/showthread...hreadid=384097