ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find in a range (https://www.excelbanter.com/excel-programming/294718-find-range.html)

Todd huttenstine

Find in a range
 
Hey guys

I need a code that will simply return true or false if a
value is found in a range.

Range C:C contains a list of values. Range A:A also
contains a list of values. What is a code that will look
at each value in range A:A and determine wheather or not
its in Range C:C. If the value is detected in range C:C
then do nothing. If the value is NOT detected in range
C:C then add it to the range at the bottom.


What is the code for this?

Thank you
Todd Huttenstine

Frank Kabel

Find in a range
 
Hi
have a look at
http://www.cpearson.com/excel/duplic...#InOneNotOther

--
Regards
Frank Kabel
Frankfurt, Germany


Todd Huttenstine wrote:
Hey guys

I need a code that will simply return true or false if a
value is found in a range.

Range C:C contains a list of values. Range A:A also
contains a list of values. What is a code that will look
at each value in range A:A and determine wheather or not
its in Range C:C. If the value is detected in range C:C
then do nothing. If the value is NOT detected in range
C:C then add it to the range at the bottom.


What is the code for this?

Thank you
Todd Huttenstine


Bob Phillips[_6_]

Find in a range
 
Something like,

cLastA = Cells(Rows.Count,"A").End(xlUp).Row
cLastC = Cells(Rows.Count,"C").End(xlUp).Row)
Set testRange = Range(C1:C" & cLastC)
For Each cell in Range("A1:A" & cLastA)
On Error Resume Next
Set oFind = testRange.Find(cell.Value)
on error goto 0
If oFind Is Nothing Then
Cells(cLastC+1,"C").Value = cell.Value
cLastC = cLastC + 1
End If
Set oFind = Nothing
Next cell

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Todd Huttenstine" wrote in message
...
Hey guys

I need a code that will simply return true or false if a
value is found in a range.

Range C:C contains a list of values. Range A:A also
contains a list of values. What is a code that will look
at each value in range A:A and determine wheather or not
its in Range C:C. If the value is detected in range C:C
then do nothing. If the value is NOT detected in range
C:C then add it to the range at the bottom.


What is the code for this?

Thank you
Todd Huttenstine





All times are GMT +1. The time now is 10:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com