+ Reply to Thread
Results 1 to 2 of 2

Create a web query referencing hyperlink in cells

Hybrid View

double a enterprises Create a web query... 07-04-2010, 02:11 AM
venkat1926 Re: Create a web query... 07-04-2010, 11:25 PM
  1. #1
    Registered User
    Join Date
    05-22-2010
    Location
    Greenville, SC
    MS-Off Ver
    Excel 2007
    Posts
    12

    Create a web query referencing hyperlink in cells

    Is there a way to create a macro that will create a web query that references a website in a cell on the workbook?
    Last edited by double a enterprises; 07-04-2010 at 09:21 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    06-17-2009
    Location
    Chennai,India
    MS-Off Ver
    Excel 2003,excel 2007
    Posts
    678

    Re: Create a web query referencing hyperlink in cells

    yes it can be done

    suppose the url is in A1
    and you want download the webpage from A2 down

    the macro will be soemthing like this

    Sub test1()
    With ActiveSheet.QueryTables.Add(Connection:= _
            "URL;" & Range("A1").Value, Destination:=Range("A2"))
    
    
    .BackgroundQuery = True
                    .TablesOnlyFromHTML = False
                    .Refresh BackgroundQuery:=False
                    .SaveData = True
                    End With
    End Sub
    of course you have to modify or tweak according to yoru requirements
    you can do experiment with some web page url is A1 of activesheet.

+ 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