rjplante
02-16-2010, 12:20 PM
I have a table of data (table 1) and I want it to check against another table (table 2) and then remove the lines from table 1 that are in table 2. I have a do loop that checks the row numbers in table 1 against those in table 2. When it finds a match in table 1, it should delete that row and then continue through the list to check for any additional matches. Table 1 has 250 rows and table 2 has 30 rows. There may be intervening spaces between rows of data that need to be removed.
I think I need to have a nested loop and I am not sure how to get this done. My code for the initial loop is listed below.
---------------------------------
Sheets("Wish List").Select
' Remove cells from wish list for orders placed
Range("A4").Select
Counter = 0
myNum = 1
Do Until Counter = 250
myNum = myNum - 1
Counter = Counter + 1
If ActiveCell.Value = Range("BP2").Value Then Exit Do
Selection.Offset(1, 0).Select
Loop
Selection.Offset(0, 1).Select
Range(Selection, Selection.Offset(0, 7)).Select
Application.Run "DEL_WL_BLOCK"
I think I need to have a nested loop and I am not sure how to get this done. My code for the initial loop is listed below.
---------------------------------
Sheets("Wish List").Select
' Remove cells from wish list for orders placed
Range("A4").Select
Counter = 0
myNum = 1
Do Until Counter = 250
myNum = myNum - 1
Counter = Counter + 1
If ActiveCell.Value = Range("BP2").Value Then Exit Do
Selection.Offset(1, 0).Select
Loop
Selection.Offset(0, 1).Select
Range(Selection, Selection.Offset(0, 7)).Select
Application.Run "DEL_WL_BLOCK"