Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
A formula would be the easiest way but if you need a macro try this:
Sub Test() Dim i As Range, iEnd As Long, iRng As Range Dim found1 As Variant, found2 As Variant With Sheets(1) iEnd = .Cells(Rows.Count, 1).End(xlUp).Row Set iRng = .Range(.Cells(1, 1), .Cells(iEnd, 1)) End With For Each i In iRng Set found1 = Sheets(2).Range("A1:IV1").Find( _ i.Value, LookIn:=xlValues) If found1 Is Nothing Then i.Offset(0, 3) = "Not Found" Else With Sheets(2) ActCol = Mid$(found1.Address, 2, 1) & ":" & _ Mid$(found1.Address, 2, 1) End With Set found2 = Sheets(2).Range(ActCol).Find( _ i.Offset(0, 1).Value, LookIn:=xlValues) If found2 Is Nothing Then i.Offset(0, 3) = "Not Found" Else i.Offset(0, 3) = "Found" End If End If Next i End Sub -- Dan Oakes |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can you copy formulas only across a large sheet, under data? | Excel Worksheet Functions | |||
copy part of large WS to another sheet | Excel Worksheet Functions | |||
Sheet File To Large due to Pivot Tables? | Excel Programming | |||
large page number in cenetr of sheet | Excel Worksheet Functions | |||
Multi-Sheet Pivot Table Too Large | Excel Discussion (Misc queries) |