Hi there, i have 2 sheets, say named a and b, sheet a contains data
extracted of the internet. Is it possible for me to program sheet b to
search for any data which is already typed out in sheet b in column b
which is in sheet a and if it is not present to say it is so. The data
in sheets a is not organised in any particular column and that is what
is giving me problems so far.
This program also needs to be shared with others so i cannot do it
manually unfortunatly.
Thanks for any help.--
trem
------------------------------------------------------------------------
trem's Profile: www.excelforum.com/member.php...oamp;userid=32222
View this thread: www.excelforum.com/showthread...hreadid=519707Try this:
Dim ws1 As Worksheet, ws2 As Worksheet
Dim rnga As Range, rngb As Range
Set ws1 = Worksheets(quot;sheet1quot;) ' lt;=== Sheet a
Set ws2 = Worksheets(quot;sheet2quot;) ' lt;=== sheet b
With ws1
Set rnga = .Range(quot;a1:aquot; amp; .Cells(Rows.Count, quot;Aquot;).End(xlUp).Row)
End With
With ws2
Set rngb = .Range(quot;b1:bquot; amp; .Cells(Rows.Count, quot;bquot;).End(xlUp).Row)
For Each cell In rngb
If Application.CountIf(rnga, cell) = 0 Then
cell.Offset(0, 1) = quot;Not foundquot; 'lt;=== column C
End If
Next
End WithOr
use a formula (in column C of sheet b); place in C1 and copy down. Change
ranges/sheet names as required :
=IF(COUNTIF(Sheet1!$A$1:$A$100,Sheet2!B1)=0,quot;Not Presentquot;,quot;Presentquot;)
HTH
quot;tremquot; wrote:
gt;
gt; Hi there, i have 2 sheets, say named a and b, sheet a contains data
gt; extracted of the internet. Is it possible for me to program sheet b to
gt; search for any data which is already typed out in sheet b in column b
gt; which is in sheet a and if it is not present to say it is so. The data
gt; in sheets a is not organised in any particular column and that is what
gt; is giving me problems so far.
gt;
gt; This program also needs to be shared with others so i cannot do it
gt; manually unfortunatly.
gt;
gt; Thanks for any help.
gt;
gt;
gt; --
gt; trem
gt; ------------------------------------------------------------------------
gt; trem's Profile: www.excelforum.com/member.php...oamp;userid=32222
gt; View this thread: www.excelforum.com/showthread...hreadid=519707
gt;
gt;
- Apr 21 Sat 2007 20:37
Finding data in a different sheet
close
全站熱搜
留言列表
發表留言