Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi everyone.
I'm trying to make a macro that can verifity two columns (in diferent sheets), now the data from one of the sheets is constantly updated. i wanted a macro to verifiy if one (of two fields) in column 2 exist.
If it does, then it wouldnt do anything. if it doesn't, it would add the data from column 1 (several cells, not just one, but in the same row).
The biggest problem is that mostly macro i've seen are really slow. i have about 1800 rows in column 2, while column 1 usually has about 800 or so.
can anyone give me a hand?
this is a macro i've seen and have been working on it...
Sub FindMissing()
Dim myRange1, myRange2, cel As Range
Set myRange1 = Sheets("Sheet1").Range("A1", Sheets("Sheet1").Range("A1").End(xlDown))
For Each cel In myRange1
Set myRange2 = Sheets("Sheet2").Range("A1", Sheets("Sheet2").Range("A1").End(xlDown))
With myRange2
If .Find(What:=cel, LookAt:=xlWhole, searchorder:=xlByRows, searchdirection:=xlNext) Is Nothing Then
'MsgBox cel
Sheets("Sheet2").Range("A1").End(xlDown).Offset(1, 0) = cel
End If
End With
Next
End Sub
with this macro i've only managed to fill one cell and only check one field (i have to verify Two).thanks in advance to everyone who took the time to read this

re: verifiy if one (of two fields) in column 2 exist".
I don't understand what you mean by this. What do you mean by a "field"?
re: if it doesn't, it would add the data from column 1 (several cells, not just one, but in the same row).
I assume that you mean that you are comparing the data in Sheet1-Column 1 to Sheet2-Column1 and then trying to copy (for example) Sheet1!Ax:Gx. Is that right?
re: The biggest problem is that mostly macro i've seen are really slow
- I put 1800 entries in Sheet(2)!A1:A1800
- I put 800 entries in Sheet(1)!A1:A800, none of which were in the Sheet2 list.
- I ran your code and it took less than 1 second to add all 800 entries to the bottom of the list in Sheet2.What's your definition of "really slow"?

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |