Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Fill Array from a CSV File


I need need help with code to open a csv file and then fill a
dimensional array with data contained in a csv file.

This is an example of a entry from the file.

Region,12345678,0001,Ex Code,525,Cust Name,Unit no,Street No,Street,S
Type,Suburb,Ex Code & Address,,,01-NOV-03,Raw Dat
String,,,,,,,,123456780001,17/10/03,10/10/03


There are approx 12,000 lines (rows) in the file which will increas
daily


thanks in advanc

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Fill Array from a CSV File

Personally I would create a new sheet and import it to
there. Then fill the array off the new sheet you have
created. I am not sure of the code to do this but you
should be able to record it or someone else will know.

Jase
-----Original Message-----

I need need help with code to open a csv file and then

fill a 2
dimensional array with data contained in a csv file.

This is an example of a entry from the file.

Region,12345678,0001,Ex Code,525,Cust Name,Unit no,Street

No,Street,St
Type,Suburb,Ex Code & Address,,,01-NOV-03,Raw Data
String,,,,,,,,123456780001,17/10/03,10/10/03


There are approx 12,000 lines (rows) in the file which

will increase
daily


thanks in advance


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from

http://www.ExcelForum.com/

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Fill Array from a CSV File

Dim varr as Variant
workbooks.Open "C:\my files\myfile.csc
varr = Activeworkbook.Worksheets(1).UsedRange.Value
Activeworkbook.close Savechanges:=False
now varr is a two dimensional array containing your values.

--
Regards,
Tom Ogilvy

Jase wrote in message
...
Personally I would create a new sheet and import it to
there. Then fill the array off the new sheet you have
created. I am not sure of the code to do this but you
should be able to record it or someone else will know.

Jase
-----Original Message-----

I need need help with code to open a csv file and then

fill a 2
dimensional array with data contained in a csv file.

This is an example of a entry from the file.

Region,12345678,0001,Ex Code,525,Cust Name,Unit no,Street

No,Street,St
Type,Suburb,Ex Code & Address,,,01-NOV-03,Raw Data
String,,,,,,,,123456780001,17/10/03,10/10/03


There are approx 12,000 lines (rows) in the file which

will increase
daily


thanks in advance


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from

http://www.ExcelForum.com/

.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default Fill Array from a CSV File

Cool!!


"Tom Ogilvy" wrote in message
...
Dim varr as Variant
workbooks.Open "C:\my files\myfile.csc
varr = Activeworkbook.Worksheets(1).UsedRange.Value
Activeworkbook.close Savechanges:=False
now varr is a two dimensional array containing your values.

--
Regards,
Tom Ogilvy

Jase wrote in message
...
Personally I would create a new sheet and import it to
there. Then fill the array off the new sheet you have
created. I am not sure of the code to do this but you
should be able to record it or someone else will know.

Jase
-----Original Message-----

I need need help with code to open a csv file and then

fill a 2
dimensional array with data contained in a csv file.

This is an example of a entry from the file.

Region,12345678,0001,Ex Code,525,Cust Name,Unit no,Street

No,Street,St
Type,Suburb,Ex Code & Address,,,01-NOV-03,Raw Data
String,,,,,,,,123456780001,17/10/03,10/10/03


There are approx 12,000 lines (rows) in the file which

will increase
daily


thanks in advance


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from

http://www.ExcelForum.com/

.





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Fill Array from a CSV File


Tom

This looks exactly like what I am after

Is there a simular simple way to fill a sheet with data held in a
Array


Thank

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Fill Array from a CSV File

Assuming myarray is a 2-D array:

rw = Ubound(myarray,1)-lbound(myarray,1)+1
col = Ubound(myarary,2)-lbound(myarray,2)+1
Range("A1").Resize(rw,col).Value = myArray

--
Regards,
Tom Ogilvy

mudraker wrote in message
...

Tom

This looks exactly like what I am after

Is there a simular simple way to fill a sheet with data held in an
Array


Thanks


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/



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
Fill in cells with an array dgh Excel Discussion (Misc queries) 0 May 15th 09 08:42 PM
Array formula fill down problem [email protected] Excel Worksheet Functions 0 January 18th 07 03:00 PM
Fill array with fn variables that vary across and down? Llurker Excel Worksheet Functions 3 May 29th 05 02:27 AM
fill down array to last available row [email protected] Excel Worksheet Functions 10 May 19th 05 10:52 PM
Fill Searched array with text [email protected] Excel Programming 3 September 26th 03 03:16 AM


All times are GMT +1. The time now is 01:28 PM.

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

About Us

"It's about Microsoft Excel"