find data in another workbook

  • Thread starter Thread starter nannon8
  • Start date Start date
N

nannon8

I am trying to put together some code that will search a specific
workbook for data, and if that data is not present in that workbook to
delete the data in the current workbook.

Can anyone help with this?
 
This should work.

Sub fndOthWb()
x = ActiveCell.Value
With Workbooks(2).Sheets(1).UsedRange
Set c = .Find(x, LookIn:=xlValues)
If Not c Is Nothing Then
Else
ActiveCell.Delete
End If
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top