+ Reply to Thread
Results 1 to 4 of 4

Sql query to get info from sheet1 to sheet2

  1. #1
    Registered User
    Join Date
    11-05-2017
    Location
    minsk
    MS-Off Ver
    2013
    Posts
    16

    Sql query to get info from sheet1 to sheet2

    Hello, everyone!

    I have an usual data-table on my sheet1
    And I want to have it on my sheet2

    How to right my vba code to do this using sql query?

  2. #2
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Sql query to get info from sheet1 to sheet2

    Privet,
    Sql between sheets in the same workbook ?
    It's possible to (ADO, QueryTables), but what for ?
    Is there any sense ?

    Try e.g.:
    Select reference to 'Microsoft Activex Data Objects Library' in vba editor: Tools\References
    Variant I
    Please Login or Register  to view this content.
    Variant II
    Please Login or Register  to view this content.
    For this data layout of sheet1 on the image below.

    See also (other cases), e.g.:
    https://www.excelforum.com/excel-pro...mport-csv.html (Kenneth Hobson)
    https://www.excelforum.com/excel-pro...ml#post4781871 (jindon)
    Attached Images Attached Images
    Last edited by mjr veverka; 02-09-2018 at 10:48 PM.

  3. #3
    Registered User
    Join Date
    11-05-2017
    Location
    minsk
    MS-Off Ver
    2013
    Posts
    16

    Re: Sql query to get info from sheet1 to sheet2

    Thanks!!

    I was in need to rename in properties my sheet name
    But at the end all was fine!
    Thanks!!

  4. #4
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Sql query to get info from sheet1 to sheet2

    Change "[Sheet1$]" in sql and in "With Sheet2" in code depending on your needs, not in vba project.
    E.g.: "[List1$]" and "With List2" or others names.
    "With Sheet2" - "Sheet2" this is the code name of the sheet, not the name of the "sheet tab", "sheet tab" may have a different name.

+ 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: 3
    Last Post: 11-06-2015, 07:24 AM
  2. to take info from sheet1 to sheet2 from horizontal to vertical.
    By karim.zheng in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-06-2015, 07:01 AM
  3. [SOLVED] Add or remove info to two lists in Sheet1 and Sheet2 and difference between two lists
    By alipezu in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-01-2014, 12:28 AM
  4. Replies: 6
    Last Post: 07-25-2013, 02:58 PM
  5. Replies: 9
    Last Post: 07-03-2013, 09:04 AM
  6. Replies: 2
    Last Post: 07-01-2013, 08:30 AM
  7. sheet1 info on sheet2, totaled by weeks, by customer, by site id
    By chestersneakers7 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-16-2013, 01:42 PM

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