Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Filter Problem - show column difference

Hi, I wonder if anyone could help with this, preferably
programmatically. I am a newbie to Filters so step by step would be
nice....

I have two columns (J and K), in which the same row may show the same
or different (text) value, depending on complex calcs elsewhere in the
sheet. J and K already have a manual autofilter set up. The rows run
from J2 to K633, with the first row showing the category name.

What I want is, a programmed filter which shows only those rows where
the column J and K values are different....

Preferably in code, so I can attach it to a button, or so I could get
it run run automatically when calculations change.....

Sounds simple enough, but hours of searching the web have drawn a
blank...

Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 638
Default Filter Problem - show column difference

How about just hiding the rows where J and K don't match? Would that
work?
Untested.
sub tester()
Dim cl as Range
Dim rng as Range
Set rng=range("J2:J633")
For Each cl In rng
If cl.Value=cl.Offset(0,1).Value Then cl.EntireRow.Hidden+True
Next cl
Set rng=Nothing
End Sub

If course, it would be best to set the range programatically just in
case it chages. You would also probably want to set all rows to
hidden=false before hiding any rows.

HTH


wrote:
Hi, I wonder if anyone could help with this, preferably
programmatically. I am a newbie to Filters so step by step would be
nice....

I have two columns (J and K), in which the same row may show the same
or different (text) value, depending on complex calcs elsewhere in the
sheet. J and K already have a manual autofilter set up. The rows run
from J2 to K633, with the first row showing the category name.

What I want is, a programmed filter which shows only those rows where
the column J and K values are different....

Preferably in code, so I can attach it to a button, or so I could get
it run run automatically when calculations change.....

Sounds simple enough, but hours of searching the web have drawn a
blank...

Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Filter Problem - show column difference

On 13 Jun, 17:49, JW wrote:
How about just hiding the rows where J and K don't match? Would that
work?
Untested.
sub tester()
Dim cl as Range
Dim rng as Range
Set rng=range("J2:J633")
For Each cl In rng
If cl.Value=cl.Offset(0,1).Value Then cl.EntireRow.Hidden+True
Next cl
Set rng=Nothing
End Sub

If course, it would be best to set the range programatically just in
case it chages. You would also probably want to set all rows to
hidden=false before hiding any rows.

HTH



wrote:
Hi, I wonder if anyone could help with this, preferably
programmatically. I am a newbie to Filters so step by step would be
nice....


I have two columns (J and K), in which the same row may show the same
or different (text) value, depending on complex calcs elsewhere in the
sheet. J and K already have a manual autofilter set up. The rows run
from J2 to K633, with the first row showing the category name.


What I want is, a programmedfilterwhich shows only those rows where
thecolumnJ and K values are different....


Preferably in code, so I can attach it to a button, or so I could get
it run run automatically when calculations change.....


Sounds simple enough, but hours of searching the web have drawn a
blank...


Thanks.- Hide quoted text -


- Show quoted text -


Thanks. That works a treat!
But it's a bit slooow. Any ideas on speeding it up?

Cheers

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
Fields show in one column problem jadeite100 Excel Programming 1 May 2nd 07 05:53 PM
Fields show in one column problem jadeite100 Excel Programming 0 May 2nd 07 04:31 PM
Auto Filter does not show all the data in the column Char Excel Worksheet Functions 2 October 3rd 06 03:34 PM
filter of column problem CG Rosén Excel Programming 1 October 8th 05 02:47 AM
add a column to a pivot table that would show the difference between 2 other Columns [email protected] Excel Worksheet Functions 7 January 30th 05 05:21 PM


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

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"