Consulting

Results 1 to 3 of 3

Thread: How to start from active cell

  1. #1
    VBAX Regular
    Joined
    Jun 2007
    Posts
    27
    Location

    How to start from active cell

    With ActiveSheet.QueryTables.Add(Connection:=connstring, Destination:=Range("A1"), Sql:=sqlstring)
     .Refresh
    End With
    With this code, the query result will be written starting from cell "A1".

    I want the query result to be written starting from the active cell I just clicked, How can I do that?

    Thanks

  2. #2
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    How about
    [VBA]
    Destination:=Activecell
    [/VBA]
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  3. #3
    VBAX Regular
    Joined
    Jun 2007
    Posts
    27
    Location
    THX

Posting Permissions

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