<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      Cross join in excel --- Copy from Internet

      Set up the Workbook

      In this example, there are two tables -- Raw Materials and Packaging -- and each table is on a separate worksheet.

      The Raw Materials table is on the sheet named Materials, and the Packaging table is on the sheet named Packaging.

      The third sheet in the workbook is named Combined, and this is where the query results will be stored.

      cartesian join with ms query

      With Microsoft Query, you can create a list that combines each item in one table, with all the items in the other table -- a Cartesian join, also called a cross join. You can read more about the different join types on the Microsoft website: Description of the usage of joins in Microsoft Query

      Open MS Query

      To create the Cartesian (cross) join, you'll use MS Query.

      1. On the Excel Ribbon, click the Data tab
      2. In the Get External Data group, click From Other Sources, then click From Microsoft Query

        Data from Microsoft Query

      3. In the Choose Data Source window, click on Excel Files*, and click OK

        choose data source

      4. In the Select Workbook window, locate and select the current workbook, and click OK.

        Select Workbook window

      5. In the Query Wizard, if you don't see the sheet names listed, click Options, and add a check mark to System Tables

        Query Wizard

      6. Click Materials$, and click the arrow to put the Raw Materials column in the query.
      7. Click Packaging$, and click the arrow to put the Packaging column in the query

        choose columns

      8. Click Cancel, to close the Query Wizard, and click Yes when prompted.

        close the query wizard

      9. In Microsoft Query, double-click on Raw Materials in the Materials$ table, to add it to the query grid.
      10. Then, double-click on Packaging, to add it to the query grid.

        add fields in MS Query

      11. Click the Return Data button, to send the data to Excel.

        send the data to Excel

      Create a Worksheet Table

      It might take a few seconds, but then the Import Data window will open.

      1. In the Import Data window, select Table
      2. Select the cell on the worksheet where you want to place the query results, and click OK.

        Import Data window

      3. A table is created, and shows all the items from each table, in all possible combinations.

        Query results table

      Add Formulas to the Table

      You can add formulas to the table, in a new column. The formulas will automatically adjust if the source tables are changed.

      1. Type a new heading in cell C1 -- MatPack -- and press Enter
      2. A new column is automatically included in the table.
      3. In cell C2, type a formula to combine the text in columns A and B, with a space character between them:

        =[@[Raw Materials]] & " " & [@Packaging]

      4. Then, copy the formula down to the last row of data in the table.

        add formula in table

      Update the Table

      You can update the source tables, and then update the query results table, to show the revised data.

      1. Add a new item to each of the source tables. In this example, Boxes was added to the Packaging list, and Cream was added to the Raw Materials list.

        update the source data

      2. On the Excel Ribbon, click the Data tab, and click Refresh All.

        refresh all

      3. The new items are shown in the updated query results table.

        updated query results table

      Manually Update the Workbook Name

      If you change the workbook name, the query will need to be updated, before it will run. To manually update the query:

      1. Right-click a cell in the results table, and click Refresh
      2. When the Login Failed message appears, click OK

        Select Workbook window

      3. In the Select Workbook window, locate and select the new workbook, and click OK.

      Select Workbook window

      Update the Query Connection with VBA

      If the file name or location will change frequently, you can use programming to automatically change the file location in the connection.

      Paste the following code -- FixQueryConnection -- into a regular module in the workbook, and then run the code when the workbook opens, by adding a Workbook_Open event.

      This code was tested in Excel 2010 (32-bit), and might need to be adjusted for other versions of Excel.

      Sub FixQueryConnection()
      '
      Dim strFile As String
      Dim strPath As String
      Dim strQry As String
      Dim strCmd As String
      Dim strConn As String
      
      strPath = ActiveWorkbook.Path & "\"
      strFile = ActiveWorkbook.Name
      strQry = "Query from Excel Files"
      strCmd = "SELECT `Materials$`.`Raw Materials`, `Packaging$`.Packaging "
      strCmd = strCmd & "FROM `Materials$` `Materials$`, `Packaging$` `Packaging$`"
      strConn = "ODBC;DSN=Excel Files;DBQ=" & strPath & strFile
      strConn = strConn & ";DefaultDir=" & strPath
      strConn = strConn & ";DriverId=790;MaxBufferSize=2048;PageTimeout=5;"
      '
          With ActiveWorkbook.Connections(strQry).ODBCConnection
              .BackgroundQuery = True
              .CommandText = strCmd
              .CommandType = xlCmdSql
              .Connection = strConn
              .RefreshOnFileOpen = False
              .SavePassword = False
              .SourceConnectionFile = ""
              .SourceDataFile = ""
              .ServerCredentialsMethod = xlCredentialsMethodIntegrated
              .AlwaysUseConnectionFile = False
          End With
          With ActiveWorkbook.Connections(strQry)
              .Name = strQry
              .Description = ""
          End With
          ActiveWorkbook.Connections(strQry).Refresh
          
          ActiveWorkbook.RefreshAll
      End Sub
      '====================================          

      Put this code into the ThisWorkbook module:

      Private Sub Workbook_Open()
        FixQueryConnection
      End Sub
      '====================================          

       

      Search Contextures Sites

       Get Excel News

       
       
       

       

      Excel Tools Add-in

      Free Pivot Table Tools

       

      Pivot Power Premium

       

      Excel Data Entry Popup List

       

       

       

      Excel UserForms for Data Entry

       

      Copyright ? Contextures Inc. 2016

      posted on 2016-10-20 15:10  Shadow Zhang  閱讀(364)  評論(0)    收藏  舉報

      主站蜘蛛池模板: 性做久久久久久久| 久久天堂综合亚洲伊人HD妓女 | 人妻内射一区二区在线视频| 亚洲国产欧美一区二区好看电影| 国精品无码一区二区三区在线蜜臀 | 尤物yw193无码点击进入| 国产午夜福利高清在线观看 | 国产熟女老阿姨毛片看爽爽| 国产女同一区二区在线| 精品国产欧美一区二区三区在线| 亚洲狠狠狠一区二区三区| 最新亚洲人成网站在线观看 | 日本五十路熟女一区二区| 亚洲久悠悠色悠在线播放| 亚洲国产高清aⅴ视频 | 人摸人人人澡人人超碰97| 精品久久久bbbb人妻| 成人又黄又爽又色的视频| 久久综合亚洲色一区二区三区| 在线精品视频一区二区| 欧美做受视频播放| 国产免费午夜福利蜜芽无码| 亚洲av无码精品蜜桃| 肥东县| 一区二区三区鲁丝不卡| 国产精品丝袜亚洲熟女| 人妻少妇无码精品专区| 欧洲国产成人久久精品综合| 一本色道久久88亚洲精品综合| 国产精品自拍实拍在线看| 一区二区和激情视频| 欧美激情一区二区三区成人| 国产精品综合av一区二区 | 亚洲少妇人妻无码视频| 亚洲中文字幕日韩精品| 拉萨市| 日本免费人成视频在线观看| 亚洲精品有码在线观看| 青青草成人免费自拍视频| 国产午精品午夜福利757视频播放| 亚洲色拍拍噜噜噜最新网站|