locked
Import text file to specific column RRS feed

  • Question

  •  

    I want to use the same worksheet to hold my text file or data imports (4) files.

    I cant see how to move the import to a given column.

    Dim wbO As Workbook 'text file

        DatFile = Application.GetOpenFilename()
         If DatFile = False Then
          Exit Sub
         End If
        Set wbO = Workbooks.Open(DatFile)
        wbO.Sheets(1).Cells.Copy wsI.Cells
        wbO.Close SaveChanges:=False


    heads up

    Tuesday, August 18, 2015 4:32 PM

Answers

  •  I want to use the same worksheet to hold my text file or data imports (4) files.

        wbO.Sheets(1).Cells.Copy wsI.Cells


    Why do you copy all cells to all cells?

    Why not copy only the used cells and use a single cell as destination?

    wbO.Sheets(1).Usedrange.Copy wsI.Range("F1")

    Andreas.

    Tuesday, August 18, 2015 4:59 PM

All replies

  •  I want to use the same worksheet to hold my text file or data imports (4) files.

        wbO.Sheets(1).Cells.Copy wsI.Cells


    Why do you copy all cells to all cells?

    Why not copy only the used cells and use a single cell as destination?

    wbO.Sheets(1).Usedrange.Copy wsI.Range("F1")

    Andreas.

    Tuesday, August 18, 2015 4:59 PM
  • explains everything....

    heads up

    Tuesday, August 18, 2015 5:23 PM