none
VBA dynamic range on web query RRS feed

  • Question

  • I'm retrieving data from a website thru Excel, and wish for the user to change the "timestamp" in the Query, but I have problems adding this. Have created this simple code, but the "range" wont accept my cellreference, any ideas?

    This webquery Works: (token anonymus,)

    Range( _ "v3_created_after_2018-12-11-09-33-16_campaign_id_153_api_token_xxxxxxxxxxxxxxxxxxxx[[#Headers],[Column1.id]]" _ ).Select Selection.ListObject.QueryTable.Refresh BackgroundQuery:=False

    This first part concatenates 3 cells into the desired datetimeformat

    Sheets("Last_Hour").Select Range("AB1").Select ActiveCell.FormulaR1C1 = _ "=START!R[3]C[-25]&""_""&START!R[4]C[-25]&""_""&START!R[5]C[-25]" Range("AB1").Select Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Sheets("Last_Hour").Select Range("A1").Select

    THIS does NOT work

    Range( _ "v3_created_after_&(""AB1"")&_campaign_id_153_api_token_xxxxxxxxxxxxxxxxxx[[#Headers],[Column1.id]]" _ ).Select Selection.ListObject.QueryTable.Refresh BackgroundQuery:=False

    How should I reference cell AB1? 

    Wednesday, December 12, 2018 8:24 AM

All replies

  • Hi,

    This is the forum to discuss questions and feedback for Microsoft Excel features, I'll move your question to the MSDN forum for Excel

    https://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.

    Regards,


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Thursday, December 13, 2018 7:50 AM