+ Reply to Thread
Results 1 to 3 of 3

Multiple Web Queries

  1. #1
    Registered User
    Join Date
    11-17-2011
    Location
    New York, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Multiple Web Queries

    Hi

    I would appreciate any help on the following issue I'm having.

    I need to pull data from an internal company phonebook and parse that data in Excel. Unfortunately I can't provide any links as they wouldn't work anyway. I will be including the .igy and workbook to show what I've been able to accomplish thus far.

    What I would like happen:
    1. Add list of ID #s to spreadsheet and automatically run a web query against the web phonebook and pull the data.
    2. Sort this data from the current single column (multiple rows) to a single row (multiple columns)
    3. Append new data to next row, not overwrite the first row.
    4. Automatically have all of the above done by running a macro or VBA.

    My apologies if I'm not explaining this properly.

    What I have done:
    1. Add list of ID #s to spreadsheet (Column A) but can only run one query (phonebook2.txt, renamed from phonebook2.igy) at a time which posts the data to column B.
    2. Used an INDEX formula to sort data from column B to Column C, D, E, etc...
    =INDEX($B:$B, COLUMN()+((ROW()-2)*8))

    Attached are the files, any help is appreciated!
    Attached Files Attached Files
    Last edited by eros18; 11-29-2011 at 03:34 PM.

  2. #2
    Registered User
    Join Date
    11-17-2011
    Location
    New York, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Multiple Web Queries

    This is what the macro recorder gave me:

    Sub WebQuery()
    '
    ' WebQuery Macro
    '

    '
    With ActiveSheet.QueryTables.Add(Connection:= _
    "FINDER;C:\Users\Zeus\AppData\Roaming\Microsoft\Queries\phonebook2.iqy" _
    , Destination:=Range("$B$2"))
    .Name = "phonebook2"
    .FieldNames = True
    .RowNumbers = False
    .FillAdjacentFormulas = False
    .PreserveFormatting = True
    .RefreshOnFileOpen = False
    .BackgroundQuery = True
    .RefreshStyle = xlInsertDeleteCells
    .SavePassword = False
    .SaveData = True
    .AdjustColumnWidth = True
    .RefreshPeriod = 0
    .WebSelectionType = xlEntirePage
    .WebFormatting = xlWebFormattingNone
    .WebPreFormattedTextToColumns = True
    .WebConsecutiveDelimitersAsOne = True
    .WebSingleBlockTextImport = False
    .WebDisableDateRecognition = False
    .WebDisableRedirections = False
    .Refresh BackgroundQuery:=False
    End With
    End Sub

  3. #3
    Registered User
    Join Date
    11-17-2011
    Location
    New York, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Multiple Web Queries

    Anyone? can't imagine this would be this difficult...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1