burdie87
Board Regular
- Joined
- May 25, 2005
- Messages
- 152
Hi Guys & Girls,
I am trying to cobble together a sub to use a cell value in my current workbook to search in a different workbook which may or may not need to be opened before the search can take place. (I have the code below which I have tried to piece together but this is a bit above my skill level.
Any help would be greatly appreciated.
I am trying to cobble together a sub to use a cell value in my current workbook to search in a different workbook which may or may not need to be opened before the search can take place. (I have the code below which I have tried to piece together but this is a bit above my skill level.
Any help would be greatly appreciated.
Code:
Private Sub CommandButton36_Click()
Dim WB As Workbook, found As Range
WB = "H:\Machine History File.xls"
Tag = Range("R12:U12")
Set found = WB.Cells.Find(What:=Tag, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False)
If Not found Is Nothing Then
ActiveCell.Offset(0, 1).Value = "ok"
End If
End Sub