fari1
Active Member
- Joined
- May 29, 2011
- Messages
- 362
my below code is perfect of extracting my another text string, but when i modify it to extract my another text string, it is not giving me results, trying real hard but unable to find the problem.
the text string to find is
out of this line
the text string to find is
HTML:
BIK=0000055135
HTML:
<td bgcolor="#E6E6E6" valign="top" align="left"><a href="/chi-kin/browse-gar?action=getcompany&BIK=0000055135&owner=include&count=100">KELLY SERVICES INC (0000055135) (Filer)</a></td>
Code:
Sub GetCIK()
Sheets("wquery").Select
Dim X As Long, LastRow As Long, OutputRow As Long, CellContent As String
Const StartRow As Long = 1
Const DataCol As String = "A"
Const OutputSheet As String = "URLs"
Const OutputCol As String = "B"
LastRow = Sheets("wquery").Cells(Rows.Count, DataCol).End(xlUp).Row
OutputRow = Worksheets(OutputSheet).Cells(Rows.Count, OutputCol).End(xlUp).Row
For X = StartRow To LastRow
If LCase(Sheets("wquery").Cells(X, DataCol).Value) Like "*getcompany&""CIK*&*" Then
OutputRow = OutputRow + 1
CellContent = Sheets("wquery").Cells(X, DataCol).Value
Worksheets(OutputSheet).Cells(OutputRow, OutputCol).Value = Split(Mid(CellContent, InStr(1, CellContent, "getcompany&""CIK", vbTextCompare) + 15), """amp")(0)
End If
Next