Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Can Excel VBA search for and read URL

I want Excel to import data from the website
http://neighbourhood.statistics.gov.uk/dissemination/ for given
postcodes, unfortunately it only works if you physically type in the
postcode on the web, as putting the postcode into the PHP style URL
doesn't work. Is Excel able to do that?

Basically I want something like this
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://neighbourhood.statistics.gov.uk/dissemination/
LeadKeyFigures.do?a=3&b=5939933&c=" & Cells(i, 17) &
"&d=14&e=16&g=409939&i=1001x1003x1004&m=0&enc= 1"


Dirk

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Can Excel VBA search for and read URL

this seemed to work when I recorded changing the original screen. I'm US so
don't understand UK postcodes.
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 7/20/2007 by Donald B. Guillett
'

'
Range("A5").Select
With Selection.QueryTable
.Connection = _
"URL;http://neighbourhood.statistics.gov.uk/dissemination/LeadAreaSearch.do?a=3&c="
& Cells(3, 1) & "&i=1001&m=0&enc=1&areaSearchText=" & Cells(3, 1) &
"&areaSearchType=13&extendedList=false&searchAreas =Search"
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingRTF
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Dirk Nachbar" wrote in message
ps.com...
I want Excel to import data from the website
http://neighbourhood.statistics.gov.uk/dissemination/ for given
postcodes, unfortunately it only works if you physically type in the
postcode on the web, as putting the postcode into the PHP style URL
doesn't work. Is Excel able to do that?

Basically I want something like this
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://neighbourhood.statistics.gov.uk/dissemination/
LeadKeyFigures.do?a=3&b=5939933&c=" & Cells(i, 17) &
"&d=14&e=16&g=409939&i=1001x1003x1004&m=0&enc= 1"


Dirk


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Can Excel VBA search for and read URL

Sorry I should have been more clear, it does work mechanically, but it
doesn't pick up the right area, the area is bascially determined by
b=5939933.

Dirk

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Can Excel VBA search for and read URL

Since I am not familiar with UK numbers and you can't explain it to
me,perhaps someone else can help.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Dirk Nachbar" wrote in message
ps.com...
Sorry I should have been more clear, it does work mechanically, but it
doesn't pick up the right area, the area is bascially determined by
b=5939933.

Dirk


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I search excel spreadsheets using multiple search criteria. Kasper Excel Worksheet Functions 4 December 15th 05 12:26 AM
Search and read registry for particular external application KS Wong[_2_] Excel Programming 1 December 11th 05 07:53 PM
Excel XP VBA code to search all macro code in Excel module for specific search string criteria Ed[_18_] Excel Programming 4 May 20th 04 02:08 PM
Excel XP VBA code to search all macro code in Excel module for specific search string criteria Frank Kabel Excel Programming 0 May 19th 04 08:11 PM


All times are GMT +1. The time now is 07:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"