Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 186
Default Importing from CSV file with the BASIC procedure

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Importing from CSV file with the BASIC procedure

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual basic 6.5 question using combo box and call procedure. TAS Excel Discussion (Misc queries) 7 April 15th 09 06:46 PM
Can I run Visual Basic procedure using Excel Visual Basic editor? john.jacobs71[_2_] Excel Programming 3 December 26th 05 02:22 PM
Importing a large amount of data using Basic MrsButtersworth Excel Programming 1 May 26th 05 05:47 AM
Basic Q: Field/Array info when importing fixed-width text files KR Excel Programming 0 March 1st 05 09:02 PM
Importing Data from a Stored Procedure (SQL SErver) Martin Eckart Excel Programming 1 January 22nd 04 01:24 AM


All times are GMT +1. The time now is 10:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"