ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   find data in another workbook (https://www.excelbanter.com/excel-programming/394339-find-data-another-workbook.html)

nannon8

find data in another workbook
 
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?


JLGWhiz

find data in another workbook
 
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

"nannon8" wrote:

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?




All times are GMT +1. The time now is 04:28 PM.

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