Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > VBA / Office Integration > Excel > AutoFilter & Sort


Reply
 
Thread Tools Display Modes
  #1  
Old 08-31-2004, 06:43 AM
Kisha Kisha is offline
Newcomer
 
Join Date: Aug 2004
Posts: 19
Default AutoFilter & Sort


Hello!

I have following Data in a Worksheet:

Price :: Status :: Item

When i filter the data via 'Item' i want that the data of 'Status' and 'Price' are sorted automatically.
Is there a way to do that automatic, or do i need an external event? (like the pushing of button?)

Thx in advance!
Reply With Quote
  #2  
Old 08-31-2004, 08:39 AM
rick_deacha's Avatar
rick_deacha rick_deacha is offline
Sith Lord

Retired Leader
* Expert *
 
Join Date: Feb 2004
Location: Monterrey, Mexico
Posts: 2,179
Default

Well if you could have a Subtotal fórmula at the end of your data... then you could use the Worksheet_Calculate Event each time you do some filtering... then you could sort your Price and Status.

Let me know if this could be a posible way to solve your problem and then we could start coding...
__________________
Rick
Use [vb][/vb] | Refer to VBA or VB | Newbie? run the Macro Recorder
Excel and VB Automation :|: Excel FAQ
Reply With Quote
  #3  
Old 08-31-2004, 03:39 PM
NateBrei's Avatar
NateBrei NateBrei is offline
Contributor
 
Join Date: Jul 2002
Location: Omaha, NE
Posts: 571
Default

If you put the formula at the end of the data, you could always hide the row (or change the font color to vbwhite) so that the formula isn't displayed. Everything would look like a normal list.

Nate
Reply With Quote
  #4  
Old 09-01-2004, 01:22 AM
Kisha Kisha is offline
Newcomer
 
Join Date: Aug 2004
Posts: 19
Default

This Subtotal-Way could work. Thx!
As NateBrei considered, i would have to hide the row where i'd put the formula.
Reply With Quote
  #5  
Old 09-01-2004, 08:26 AM
rick_deacha's Avatar
rick_deacha rick_deacha is offline
Sith Lord

Retired Leader
* Expert *
 
Join Date: Feb 2004
Location: Monterrey, Mexico
Posts: 2,179
Default

Let see if this helps you
Attached Files
File Type: zip example.zip (7.1 KB, 3 views)
__________________
Rick
Use [vb][/vb] | Refer to VBA or VB | Newbie? run the Macro Recorder
Excel and VB Automation :|: Excel FAQ
Reply With Quote
  #6  
Old 09-03-2004, 01:16 AM
Kisha Kisha is offline
Newcomer
 
Join Date: Aug 2004
Posts: 19
Default

It's excatly that what i wanted!
Thx!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->