Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Filter Column

Hi Friends,

I want to filter data columnwise not row wise.
eg.
Stationey Purchased List

Item Jan Feb March April May June
Pen y y y y
Pencil y y y
Scale y y y
Rubber y y y y

Now I want to filter Pencil purchased in which month, means want to filter
only pencil with only purchased month, other months will be off.

First I filter Pencil then how I will get the only purchased month.

Result will be like that

Item Jan Feb April
Pencil y y y


Please help me to solve this problem.

With loves,
Sudipta

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Filter Column

An interesting question. Try this sample:

Sub SuperFilter()
Dim r As Range
Set r = ActiveSheet.UsedRange
nLastRow = r.Rows.Count + r.Row - 1
nLastColumn = r.Columns.Count + r.Column - 1
st = Application.InputBox(prompt:="enter item: ", Type:=2)

For i = 2 To nLastRow
If Cells(i, 1).Value < st Then
Cells(i, 1).EntireRow.Hidden = True
Else
nn = i
End If
Next

For i = 2 To nLastColumn
If Cells(nn, i).Value < "y" Then
Cells(nn, i).EntireColumn.Hidden = True
End If
Next

End Sub

It will hide the un-wanted rows AND the un-wanted columns.
--
Gary''s Student - gsnu201001


"Sudipta Sen" wrote:

Hi Friends,

I want to filter data columnwise not row wise.
eg.
Stationey Purchased List

Item Jan Feb March April May June
Pen y y y y
Pencil y y y
Scale y y y
Rubber y y y y

Now I want to filter Pencil purchased in which month, means want to filter
only pencil with only purchased month, other months will be off.

First I filter Pencil then how I will get the only purchased month.

Result will be like that

Item Jan Feb April
Pencil y y y


Please help me to solve this problem.

With loves,
Sudipta

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
column filter Sudipta Sen[_2_] Excel Discussion (Misc queries) 1 December 30th 09 02:15 PM
How do I count nonblanks in column A when I filter by column B RP3 Excel Worksheet Functions 5 January 13th 09 05:05 PM
Filter only one column rah44 Excel Discussion (Misc queries) 3 October 31st 07 03:07 PM
filter only one column LMD New Users to Excel 1 September 7th 07 06:03 PM
Best way to search/filter a column? Kobayashi[_9_] Excel Programming 5 October 12th 03 12:20 AM


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