PDA

View Full Version : Auto Copy a website table into excel



greenculture
12-09-2013, 11:55 PM
i want to get all data from this website

h t t p : / / portal.maccem.com.au:8080/cgi-bin/portalnew.sh/portal/namesenq.p?surname=a&firstname=&othernames=&knownas=&yearfrom=&yearto=&postfunc=Search&companyid=3&scrollx=0&scrolly=0


i want excel vba template like this 10936
this article will help to solve this problem.

mrexcel.com/tip072.shtml

any one can create xls template for this

Jan Karel Pieterse
12-11-2013, 05:31 AM
I cannot access the website you refer to, it is probably on your company intranet.
Try Data, From Web.

snb
12-11-2013, 07:41 AM
Sub tst()
With New winhttprequest
.Open "get", "http://portal.maccem.com.au:8080/cgi-bin/portalnew.sh/portal/namesenq.p?surname=b&firstname=&othernames=&knownas=&yearfrom=&yearto=&postfunc=Search&companyid=3&scrollx=0&scrolly=0"
.send
sn = Split(Replace(Replace(Join(Filter(Split(.ResponseText, vbLf), "<td align=""left"">"), ""), "&nbsp;", ""), "<td align=""left"">", ""), "</td>")

For jj = 0 To UBound(sn)
sn(jj) = Trim(sn(jj)) & IIf(InStr(sn(jj), "/"), "#", "")
Next
sn = Split(Join(sn, "_"), "#_")

Cells(1, 10).Resize(UBound(sn) + 1) = Application.Transpose(sn)
End With
End Sub

NB. Activate reference:

Microsoft WinHTTPServices, version 5.1