LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Web Query

As always, you should post YOUR coding efforts for comments and suggestions.
In xl2002, I just right clicked on the table to import to exceledited the
query to get the table desired. Then you can use a macro to extract or
delete or hide the columns desired. Here is a macro recorded after importing
to get the desired tables. Many lines are unnecessary.


Sub Macro1()
'
' Macro1 Macro
' Macro recorded 4/12/2006 by Don Guillett
'

'
With Selection.QueryTable
.Connection = "URL;http://www.2adsdirect.com/SList.asp?vPool=C"
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "2,3,5,6,7,8,9,10"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub
========
A VERY crude recorded macro to get the desired info.
Again, needs to be cleaned up to remove unnecessary steps and selections
such as

Columns("H").Cut Columns("K").Insert Shift:=xlToRight


Sub Macro2()
'
' Macro2 Macro
' Macro recorded 4/12/2006 by Don Guillett
'

'
Columns("H:H").Select
Selection.Cut
Columns("K:K").Select
Selection.Insert Shift:=xlToRight
ActiveWindow.SmallScroll ToRight:=-2
Columns("A:A").Select
Selection.Cut
ActiveWindow.SmallScroll ToRight:=3
Columns("K:K").Select
Selection.Insert Shift:=xlToRight
Range("J7").Select
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
Columns("A:G").Select
Selection.Delete Shift:=xlToLeft
Columns("D:G").Select
Selection.Delete Shift:=xlToLeft
Rows("1:15").Select
Selection.Delete Shift:=xlUp
Range("A1").Select
Columns("C:C").EntireColumn.AutoFit
End Sub



--
Don Guillett
SalesAid Software

"ssjody" wrote in
message ...

Total Newbie here. I have wrote some simple code but I need help on this
one. I need to import data from a website located at
http://www.2adsdirect.com/SList.asp?vPool=C into an excel worksheet by
clicking on a Button within the worksheet.

The table is updated often and always varies in the number of rows.
Once every two weeks the table starts over.

I need help with the code to import the data without the header rows

I only need the VIN, Mileage, and Sale# columns

I need the data in this order VIN, Mileage, and Sale#

I need for the Mileage to not have the 1000's separator.

Any help on how to start this project of some code samples that may
work for this project would be tremendously appreciated.

Thanks Jody


--
ssjody
------------------------------------------------------------------------
ssjody's Profile:
http://www.excelforum.com/member.php...o&userid=33398
View this thread: http://www.excelforum.com/showthread...hreadid=532206



 
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
Convert hard coded query criteria to Parameter Query Melanie[_2_] Excel Discussion (Misc queries) 0 July 15th 08 09:59 PM
Excel 2007 / MS Query - editing existing query to another sheet Hotpepperz Excel Discussion (Misc queries) 0 June 13th 08 06:53 PM
Anyone Else Use Database Query to Query Another Sheet in the Same Excel Workbook? jocke Excel Discussion (Misc queries) 1 November 29th 05 01:44 PM
Anyone Else Use Database Query to Query Another Sheet in the Same Excel Workbook? jocke Excel Discussion (Misc queries) 0 November 28th 05 06:37 PM
Edit Query from Excel will not open query in MSQuery Michelle Excel Programming 0 February 21st 05 03:59 PM


All times are GMT +1. The time now is 12:37 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"