Campbell Botting
New Member
- Joined
- Jun 9, 2015
- Messages
- 7
I am running the following code to find the first entry in a sheet. Works OK for the general data but not the second call which is searching for a named IP address. It comes up with an "Object variable or With Block Variable not set" error
Code:
Code:
Code:
Sub Find()
'
' Find Macro
'
'
Range("A2").Select
'Find asset name on CCL Manage report and get IP number
findcolumn = "A:A"
searchdata = ActiveCell.Value
searchsheet = "CCLManage Report"
Call findentry(searchdata, findcolumn, searchsheet)
ipnumber = ActiveCell.Offset(0, 7).Value
'find ip number on splunk report
findcolumn = "D:D"
searchdata = ipnumber
searchsheet = "splunk_12-6-2015"
Call findentry(searchdata, findcolumn, searchsheet)
End Sub
Sub findentry(searchdata, findcolumn, searchsheet)
ActiveWorkbook.Sheets(searchsheet).Activate
Range(findcolumn).Select
'find entry
Selection.Find(What:=searchdata, After:=ActiveCell, LookIn:=xlValues _
, LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
End Sub
Last edited by a moderator: