Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 'Group by' facility?

Hi,

I've a lot of csv files to process. In each one I need to summ some columns
where one or two other columns are the same.
In a database table this would be easy using a SQL 'group by' statement.
Is there a similar method I could use in VBA?

Thanks in advance
SW


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default 'Group by' facility?

Pivot tables are about as close as you'll get. Unless you want to treat the
same workbook as a Jet SQL source and query it.


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Steve W" wrote in message
...
Hi,

I've a lot of csv files to process. In each one I need to summ some
columns where one or two other columns are the same.
In a database table this would be easy using a SQL 'group by' statement.
Is there a similar method I could use in VBA?

Thanks in advance
SW



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 'Group by' facility?

Treating it as a Jet SQL source sounds useful. How do I do that?

Thanks
SW

"Rob van Gelder" wrote in message
...
Pivot tables are about as close as you'll get. Unless you want to treat

the
same workbook as a Jet SQL source and query it.


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Steve W" wrote in message
...
Hi,

I've a lot of csv files to process. In each one I need to summ some
columns where one or two other columns are the same.
In a database table this would be easy using a SQL 'group by' statement.
Is there a similar method I could use in VBA?

Thanks in advance
SW





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 593
Default 'Group by' facility?

SW wrote:
Treating it as a Jet SQL source sounds useful. How do I do that?


Sub just_four_lines()
Dim rs As Object
Set rs = CreateObject("ADOR.Recordset")
rs.Open _
"SELECT COUNT(*) as customer_count," & _
" Country FROM MyFile#csv" & _
" GROUP BY Country" & _
" ORDER BY COUNT(*), Country", _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\MyFolder\;" & _
"Extended Properties='Text;HDR=Yes';"
Sheet1.Range("A1").CopyFromRecordset rs
End Sub

For more details <g, see:

http://msdn.microsoft.com/library/de...ng03092004.asp

Jamie.

--

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
List Box with lookup facility Col Excel Worksheet Functions 1 October 14th 08 01:49 AM
Is there a 'floating key/ legend' facility? Andrew at fourninety.com Excel Discussion (Misc queries) 2 June 22nd 07 11:48 AM
Spelling Facility Zygy New Users to Excel 2 December 11th 06 05:49 PM
how do i use LOTUS combine facility in Excel seawardr Excel Discussion (Misc queries) 3 October 22nd 06 10:23 PM
search facility darren Excel Programming 2 June 9th 04 09:54 AM


All times are GMT +1. The time now is 11:02 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"