Tags: a10a20, basic, colums, csv, excel, extract, file, importing, microsoft, msdn, procedure, software, vba, write

Importing from CSV file with the BASIC procedure

On Microsoft » Microsoft Excel

1,744 words with 1 Comments; publish: Sun, 01 Jun 2008 13:28:00 GMT; (306109.38, « »)

Hi,

Can someone help me? I need to write THE BASIC vba procedure to extract a

..csv (first name , last name) that will be sent to colums (A10:A20) and

(B10:B20).

Thanks.

Joe

All Comments

Leave a comment...

  • 1 Comments
    • I used a learn macro and got the following code. You can eliminate a number

      of the parameters. they aren't really needed. I added a comment to these

      unecessary lines

      Sub Macro1()

      '

      ' Macro1 Macro

      ' Macro recorded 6/13/2007 by Joel

      '

      '

      With ActiveSheet.QueryTables.Add(Connection:="TEXT;C:\T EMP\f_l.csv", _

      Destination:=Range("A10"))

      .Name = "f_l"

      .FieldNames = True

      ' .RowNumbers = False

      ' .FillAdjacentFormulas = False

      .PreserveFormatting = True

      .RefreshOnFileOpen = False

      ' .RefreshStyle = xlInsertDeleteCells

      ' .SavePassword = False

      .SaveData = True

      .AdjustColumnWidth = True

      ' .RefreshPeriod = 0

      ' .TextFilePromptOnRefresh = False

      ' .TextFilePlatform = 437

      ' .TextFileStartRow = 1

      .TextFileParseType = xlDelimited

      .TextFileTextQualifier = xlTextQualifierDoubleQuote

      .TextFileConsecutiveDelimiter = False

      ' .TextFileTabDelimiter = False

      ' .TextFileSemicolonDelimiter = False

      .TextFileCommaDelimiter = True

      ' .TextFileSpaceDelimiter = False

      .TextFileColumnDataTypes = Array(1, 1)

      ' .TextFileTrailingMinusNumbers = True

      ' .Refresh BackgroundQuery:=False

      End With

      End Sub

      "Jack" wrote:

      > Hi,

      > Can someone help me? I need to write THE BASIC vba procedure to extract a

      > .csv (first name , last name) that will be sent to colums (A10:A20) and

      > (B10:B20).

      > Thanks.

      > Joe

      #1; Sun, 01 Jun 2008 13:30:00 GMT