Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Fetch Text From Website
Hi All,
How can I get the news description from the below mentioned link to a particular cell (say sheet1, Range("A1") using VBA. Is this possible?? http://www.commercialpropertynews.co..._id=1003559988 Dileep |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Fetch Text From Website
Hi Dileep
I'm not used to this sort of thing but below is the code recorded by excel while i got the data from the site you gave using a web query it's very scrappy but it works and should give you an idea of what to do. you might want to search help for importing data into excel as well Sub RunMyCode() With ActiveSheet.QueryTables.Add(Connection:= _ "URL;http://www.commercialpropertynews.com/cpn/ article_display.jsp?vnu_content_id=1003559988" _ , Destination:=Range("A1")) .Name = "article_display.jsp?vnu_content_id=1003559988 " .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .BackgroundQuery = True .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .WebSelectionType = xlSpecifiedTables .WebFormatting = xlWebFormattingNone .WebTables = "11" .WebPreFormattedTextToColumns = True .WebConsecutiveDelimitersAsOne = True .WebSingleBlockTextImport = False .WebDisableDateRecognition = False .WebDisableRedirections = False .Refresh BackgroundQuery:=False End With End Sub S |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Fetch Text From Website
Thank you for the suggetion. But how can alter this code to get data
from another page without manually altering the URL in the code? I need to get data from multiple web pages. -Dileep |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Fetch Text From Website
Take the code sampleprovided, add a parameter "URL" and then use that to
pass in the URL for each page. Sub RunMyCode(sURL as String) With ActiveSheet.QueryTables.Add(Connection:= "URL;" & sURL, Destination:=Range("A1")) 'etc.... You don't say where your list is kept, so it's difficult to suggest details of how you might loop through the URL's. Tim "Dileep Chandran" wrote in message ups.com... Thank you for the suggetion. But how can alter this code to get data from another page without manually altering the URL in the code? I need to get data from multiple web pages. -Dileep |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Fetch Text From Website
Tim,
My URL's are kept in Sheet1 Range("A2:A20"). Any suggetions?? -Dileep |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Fetch Text From Website
Please quote when replying - it makes everyone's life easier.
Try this: '******************** Dim c as range for each c in Sheet1.Range("A2:A20") RunMyCode(c.value) next c -- Tim Williams Palo Alto, CA "Dileep Chandran" wrote in message ups.com... Tim, My URL's are kept in Sheet1 Range("A2:A20"). Any suggetions?? -Dileep |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
fetch values from w/sheet | Excel Discussion (Misc queries) | |||
pasting data from a website changes text to date | Excel Discussion (Misc queries) | |||
Fetch parameters from web into Excel | Excel Programming | |||
how to fetch a row and post the row into another sheelt | Excel Worksheet Functions | |||
Importing text from a website | New Users to Excel |