+ Reply to Thread
Results 1 to 2 of 2

VBA to Pull Data

  1. #1
    Forum Contributor
    Join Date
    11-10-2019
    Location
    India
    MS-Off Ver
    2010
    Posts
    143

    VBA to Pull Data

    Dear Experts !

    I have two sheets in excel

    1. Query
    2. Data

    The query sheets returns the url correctly for which I have written below code

    Sub Retrieve()

    Dim Webquery As String

    Webquery = ActiveWorkbook.Worksheets("Query").Cells(1, 1).Value

    End Sub

    Problem
    Now, I need to continue this code to to populate data in sheet named data. It is not a query table. the Moment Webquery string output is executed, data comes to excel sheet.

    Now, how do I execute output of Webquery at cell A1 in sheet "Data'

  2. #2
    Forum Contributor
    Join Date
    11-10-2019
    Location
    India
    MS-Off Ver
    2010
    Posts
    143

    Re: VBA to Pull Data

    Tried the following but getting error "1004"

    Sub Retrieve()
    Dim Webquery As String
    Webquery = ActiveWorkbook.Worksheets("Query").Cells(1, 1).Value ' Get the URL from cell A1 of Sheet "Query"
    With ActiveSheet.QueryTables.Add(Connection:= _
    "Webquery" _
    , Destination:=Range("$A$2"))
    End With
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 07-08-2015, 06:31 AM
  2. Pull Data from Sheet Based on Criteria -- Populate UserForm & ask for Missing Data
    By roxybethany in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-15-2014, 12:08 PM
  3. Pull Data from Sheet Based on Criteria -- Populate UserForm & ask for Missing Data
    By roxybethany in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-08-2014, 02:05 PM
  4. Need to pull data from closed file, sort, and send the data to specific sheets.
    By ghostman73 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-05-2013, 05:13 PM
  5. help on vba code to pull data with conditions ,filename,avoid header,unfiltered data
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-27-2013, 05:57 AM
  6. Pull Data from Multiple Columns Based On Data Validation List Selection
    By CHRISOK in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-13-2013, 11:41 PM
  7. Use of Excel to pull data from database daily, posting new data below older data
    By Ishness in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-09-2011, 10:08 AM

Tags for this Thread

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