Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I've got following situation. I've got 2 sheets and I want to find these rows in Sheet1, which contains values from Sheet 2 (2 cells in row only). My idea is to first loop through rows in Sheet1 and inside this loop have another loop through range from Sheet2. The problem is how to read values from rows in Sheet2 to compare them with cells values from Sheet1. TIA Przemek |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim cell as Range, cell1 as Range, rw as Range
for each cell in Worksheets("Sheet1").Range("A1:A10") if application.Countif(Worksheets("Sheet2").Range("B9 :F32"),cell.Value) 0 then ' a match exists, find it for each rw in Worksheets("Sheet2").Range("B9:F32") for each cell1 in rw.cells if cell.value = cell1.value then msgbox "Found at " & cell1.Address(0,0,xlA1,True) end if Next Next End if Next There are faster ways, but this does looping similar to your suggestion -- Regards, Tom Ogilvy "Przemek" wrote in message oups.com... Hi, I've got following situation. I've got 2 sheets and I want to find these rows in Sheet1, which contains values from Sheet 2 (2 cells in row only). My idea is to first loop through rows in Sheet1 and inside this loop have another loop through range from Sheet2. The problem is how to read values from rows in Sheet2 to compare them with cells values from Sheet1. TIA Przemek |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
SUMPRODUCT or SUMIF if any values in a range equal any values in another range | Excel Worksheet Functions | |||
Make all values of a 3D named range appear on summary sheet | Excel Discussion (Misc queries) | |||
Paste range of values into filtered sheet | Excel Discussion (Misc queries) | |||
Placing values in a range on a non-active sheet | Excel Programming | |||
Copying a particular range of values from one sheet to another in excel | Excel Programming |