Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Convert hard coded query criteria to Parameter Query | Excel Discussion (Misc queries) | |||
Excel 2007 / MS Query - editing existing query to another sheet | Excel Discussion (Misc queries) | |||
Anyone Else Use Database Query to Query Another Sheet in the Same Excel Workbook? | Excel Discussion (Misc queries) | |||
Anyone Else Use Database Query to Query Another Sheet in the Same Excel Workbook? | Excel Discussion (Misc queries) | |||
Edit Query from Excel will not open query in MSQuery | Excel Programming |