Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default .IQY loop in VBA?

I am using Excel 200 and XP. I have just learnt how to use an .iqy
file to extract data from the web. To really benefit from automation
I want to create a loop using slightly different web adresses each
time. I have recorded the query as a macro and get:

Sub Macro1()
With Selection.QueryTable
.Connection = "URL;http://www.skyscanner.net/gbp/flights/ABZ/
LTN"
.WebSelectionType = xlAllTables
.WebFormatting = xlWebFormattingAll
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.Refresh BackgroundQuery:=False
End With
End Sub

Ok - so far so good. By varying ABZ and LTN in the web address I get a
different set of results.

I have a table containing these two variables in a 25R x 2C table
called 'sectors' on a separate sheet 'OAG'

How do I create a loop to work systematically down the 'sectors'
table, recording the inputs and creating an output for each input
pair?

The output data block is 11R x 7 C so I will have to jump 12 rows
before each loop unless there is a neat way to put the data into a
single row.

Any ideas?
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
Naming Worksheets - Loop within a loop issue klysell Excel Programming 5 March 29th 07 05:48 AM
Naming Worksheets - Loop within a loop issue klysell Excel Programming 0 March 27th 07 11:17 PM
(Complex) Loop within loop to create worksheets klysell Excel Programming 1 March 20th 07 12:03 AM
Advancing outer Loop Based on criteria of inner loop ExcelMonkey Excel Programming 1 August 15th 05 05:23 PM
Problem adding charts using Do-Loop Until loop Chris Bromley[_2_] Excel Programming 2 May 23rd 05 01:31 PM


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

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

About Us

"It's about Microsoft Excel"