Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Getting Data from Web - where the URL is the value of the active c

Well, I am so very smart... I figured it out for myself.

In case you need it ,here is the vba code that does the following:
1. Creates a new worksheet named "Working Data"
2. Then extracts data tables 3 and 4 from the webpage and pastes it on the
sheet "Working Data".
3. The difference here is that the URL for the webpage is the text of the
active cell prior to running the macro.
4. That is, say before running the macro, the active cell is A1 on Sheet1 -
and this cell has the text "http://www.WEBSITE.com".

Sub GetDataFromActiveCellWebSite()

Dim WEBNAME As String
WEBNAME = ActiveCell.Value


ActiveWorkbook.Worksheets.Add().NAME = "Working Data"
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;" & WEBNAME, Destination:=Range("$A$1"))
.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 = "3,4"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With


Hop that helps you.
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
Row select mode to highlight active row of active cell Bart Fay[_2_] Excel Discussion (Misc queries) 0 May 11th 10 09:34 PM
run macro although blinking cursor is active in an active cell bartman1980 Excel Programming 1 December 20th 07 11:29 AM
Data Connection - Active Directory Rob Excel Discussion (Misc queries) 1 August 11th 06 06:56 PM
HOW TO COPY 480 ACTIVE E-MAIL ADDRESSES CLM "G" ON AN ACTIVE EXCE. ragman10 Excel Discussion (Misc queries) 1 December 13th 04 11:52 PM
Active X and Data Grid Richard Mogy Excel Programming 2 May 18th 04 03:03 PM


All times are GMT +1. The time now is 06:43 AM.

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

About Us

"It's about Microsoft Excel"