ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   string sorting problem (https://www.excelbanter.com/excel-programming/297004-string-sorting-problem.html)

NikkoW

string sorting problem
 
I have four workbooks, each containing a list of customer names and the
number of products they have ordered from us. I can't combine the lists into
one because there are too many entries. A given customer's name could appear
in more than one of the workbooks.

I need to combine all entries, across all four books, for one customer at a
time, and write that name once and the sum of all products they ordered into
a fifth workbook.

I have sorted each workbook by name and written most of the code for the
project. What I am missing:

How do I compare strings to sort alphabetically?



Tom Ogilvy

string sorting problem
 
Use the sumif function

tot = 0
for i = 1 to 4
tot = tot + application.Sumif( _
workbooks(1).Worksheets(1).Range("A:A"), customer_name, _
workbooks(1).Worksheets(1).Range("B:B")
Next

--
Regards,
Tom Ogilvy


"NikkoW" wrote in message
le.rogers.com...
I have four workbooks, each containing a list of customer names and the
number of products they have ordered from us. I can't combine the lists

into
one because there are too many entries. A given customer's name could

appear
in more than one of the workbooks.

I need to combine all entries, across all four books, for one customer at

a
time, and write that name once and the sum of all products they ordered

into
a fifth workbook.

I have sorted each workbook by name and written most of the code for the
project. What I am missing:

How do I compare strings to sort alphabetically?






All times are GMT +1. The time now is 04:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com