Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Interpret HTML in excel worksheet

Hi,

I am grabbing some data from an html table using the following code:


-----------------------------------------------------------------------------
Dim url As String
Dim startTag As String
Dim endTag As String
Dim playerStats As Variant
Dim newPlayerArray As Variant
Dim counter As Single
'""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""
' player import
'""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""

url =
"http://www.sportsline.com/nhl/stats/playersort/regularseason/yearly/NHL/?&print_rows=9999"
startTag = "<div class=SLTables1"
endTag = "</div"


playerStats = gsGetString(url, startTag, endTag)

------------------------------------------------------------------------------

What I want to be able to do is take playerStats and PasteSpecial -
Unicode into Worksheets("test").Range("A1")

This will properly form a worksheet with all the statistics I am
looking for.

Any ideas would be appreciated.

Thanks
Dave

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Interpret HTML in excel worksheet

Dave

You can put that text into the clipboard using a DataObject, then use
PasteSpecial normally. The DataObject object is part of the Microsoft Forms
2.0 Library, so you'll need to set a reference if you haven't already
(Tools - References). Your code will look something like

Set objData as New DataObject

objData.SetText = playerStats
objData.PutInClipBoard

Sheet1.Range("A1").Select
Sheet1.PasteSpecial "Unicode Text"

See http://www.dicks-blog.com/archives/2...l-in-cells-ii/ for
another example using DataObject.


--
Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.com



wrote:
Hi,

I am grabbing some data from an html table using the following code:


-----------------------------------------------------------------------------
Dim url As String
Dim startTag As String
Dim endTag As String
Dim playerStats As Variant
Dim newPlayerArray As Variant
Dim counter As Single
'""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""
' player import
'""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""

url =
"http://www.sportsline.com/nhl/stats/playersort/regularseason/yearly/NHL/?&print_rows=9999"
startTag = "<div class=SLTables1"
endTag = "</div"


playerStats = gsGetString(url, startTag, endTag)

------------------------------------------------------------------------------

What I want to be able to do is take playerStats and PasteSpecial -
Unicode into Worksheets("test").Range("A1")

This will properly form a worksheet with all the statistics I am
looking for.

Any ideas would be appreciated.

Thanks
Dave



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Interpret HTML in excel worksheet

Thanks very much. I will give that a shot tonite when I get home.
Much appreciated!!

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
Add link to specific Excel worksheet in HTML Outlook message [email protected] Links and Linking in Excel 4 May 17th 23 11:47 AM
How to interpret string as a number in Excel 2007 ? AntonAL Excel Discussion (Misc queries) 3 November 6th 08 06:31 PM
Eliminate Excel worksheet tab when saving as HTML? Midjack Excel Discussion (Misc queries) 2 September 27th 08 06:20 PM
Why does Excel interpret 2/29 as Feb 1st? Jo Excel Discussion (Misc queries) 6 February 26th 05 06:06 PM
From HTML open a specific worksheet within a excel file esoller Excel Programming 2 May 18th 04 09:41 PM


All times are GMT +1. The time now is 02:16 PM.

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"