Check to see if cell value exists

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

I am using Excel 97 and want to be able to check to see if
a cell value on one sheet is already listed in a range on
another sheet.

If the cell value is listed then move to the next cell
down, if not listed then copy the value of that cell into
the next cell available in the range on the sheet.

Can anyone assist with some code please?

Thanks

Mark
 
I can't find anything suitable in my HELP, I did try this
first!

Can anyone else offer any more suggestions/code, please?
 
Try this

It will look in each cell in Sheets("Sheet1").Range("a1:a10")
If a cell value not exist in Sheet2 in column A it will copy the cell to the
next available cell in sheet2 column A


Sub Copy_test()
For Each cell In Sheets("Sheet1").Range("a1:a10")
If Application.WorksheetFunction.CountIf(Sheets("sheet2").Range("A:A") _
, cell.Value) = 0 Then
cell.Copy Sheets("sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
End If
Next
End Sub
 
Back
Top