There is surely a way to achieve that. Why do it unnecessarily? Let's follow
a simple approach. Arrange the list incorporating an additional column,
"Supplier", so the data looks like -
Supplier A Product A Class 1
Supplier A Product B Class 1
Supplier B Product C Class3
Supplier B Product A Class2
Now, using the Data-Sort, you can easily sort the list on Supplier, within
that on Product and so on. It is worth bringing in this data redundancy for
obvious reasons.
If however, do not want to do this, for sorting purpose, insert a temporary
column to contain suppliers, sort the list, and get rid of the temporary
column. Lets say we insert a column in place of Column A. Column B on lies
your existing list. in column A type in the formula
=IF(AND(C1="",B1=""),B2&"|"&CHAR(1),IF(C1="",B1&"|"&CHAR(2),LEFT(INDIRECT("A"&ROW()-1),SEARCH("|",INDIRECT("A"&ROW()-1),1))&B1))
copy this formula across column A, from first Row of column B to last row of
column B.
this gets the supplier names in Column A. Now Sort the list, on Column A,
Column B, Column C.
Let me know if this works....
Regards,
Ajit
On Mon, Sep 22, 2008 at 7:12 PM, Suhas <[EMAIL PROTECTED]> wrote:
>
> Hi All,
>
> I have Grouped Supplier data as below.
>
> Supplier A
> Product A Class 1
> Product B Class 1
>
> Supplier B
> Product C Class3
> Product A Class2
>
> I need to sort the Groups ( Supplier A , Supplier B ..... so on) But
> when i sort using Data> Sort function Excel Sorts all the contents in
> the column.
>
> Is there any way to work this out through VB, Will Named Ranges
> work???? This list will be updated every month.
>
> Thanks in advance.
>
> Chetan
>
> >
>
--
Thank You,
Ajit Navre
--~--~---------~--~----~------------~-------~--~----~
Visit the blog to download Excel tutorials at
http://www.excel-macros.blogspot.com
To post to this group, send email to [email protected]
For more options, visit this group at
http://groups.google.com/group/excel-macros?hl=en
Visit & Join Our Orkut Community at
http://www.orkut.com/Community.aspx?cmm=22913620
Visit the blog to download Excel tutorials at
http://www.excel-macros.blogspot.com
To Learn VBA Macros Please visit http://www.vbamacros.blogspot.com
To see the Daily Excel Tips, Go to:
http://exceldailytip.blogspot.com
-~----------~----~----~----~------~----~------~--~---