Hi
I need to find a word in another workbook, I think the problem is with "Cells.Find(What:=text).Select"
The error is receive is runtime error 91 object variable or with block variable not set
Sub Find()
Dim text As String
Dim text1 As String
ThisWorkbook.Activate
'Find row/cell to pick up string
locate = Cells.Find(What:="Operator", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
text = ActiveCell.text
'Filter out required string - string contains the word normally contained in <> brackets
text = Mid(text, 21, 6)
'MsgBox Right(text, 8)
'Activate Workbook
On Error GoTo msg
Workbooks("Test.csv").Activate
'This is where I want to find the word in new workbook, but fails
Cells.Find(What:=text).Select
'Move left to User ID and Copy
ActiveCell.Offset(0, -3).Activate
ActiveCell.Copy
'Paste User ID in this workbook
ThisWorkbook.Activate
ActiveCell.Offset(0, 3).Activate
ActiveSheet.Paste
End Sub
Bookmarks