Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub FindPhrase()
- Dim i As Long, searchCol As Long, dCell As Range, ws As Worksheet
- Set ws = ActiveSheet
- 'column A
- searchCol = 1
- 'output cell
- Set dCell = ws.Range("B1")
- 'search through cells in specified column
- For i = 1 To ws.Cells(ws.Rows.Count, searchCol).End(xlUp).Row
- If InStr(ws.Cells(i, searchCol), "The cpu utilization is ") > 0 And InStr(ws.Cells(i, searchCol), "%") > 0 Then
- dCell.Value = CDbl(Replace(Mid(ws.Cells(i, searchCol), InStr(ws.Cells(i, searchCol), "%") - 2, 2), "%", ""))
- Exit For
- End If
- Next i
- End Sub
Add Comment
Please, Sign In to add comment