Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / December 2007

Tip: Looking for answers? Try searching our database.

Filtering depending on value of a cell

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Khalil Handal - 28 Dec 2007 19:08 GMT
Hi to all,
Is it possible to filtration according to a value that is typed in a certain
cell?

Colomn B contain month names: Jan, Feb, ... until Dec. Is it possible to
filltering using VB Code or Macro.. depending on the value that I type in
cell C4?
After that to print the filtered range starting colomn C until colomn L
after hiding colomns F,G,H,I . Colomn headings are in row 6
Wigi - 28 Dec 2007 22:06 GMT
Yes, you can program the Autofilter.

Have a look in the newsgroups here, that kind of question has been answered
a lot of times of before.

You can reference the value of a cell using:

Sheets("nameofthesheet").Range("thecelladdress").Value

Signature

Wigi
http://www.wimgielis.be = Excel/VBA, soccer and music

> Hi to all,
> Is it possible to filtration according to a value that is typed in a certain
[quoted text clipped - 5 lines]
> After that to print the filtered range starting colomn C until colomn L
> after hiding colomns F,G,H,I . Colomn headings are in row 6
Khalil Handal - 28 Dec 2007 23:22 GMT
Can you specify a reference please??

> Yes, you can program the Autofilter.
>
[quoted text clipped - 16 lines]
>> After that to print the filtered range starting colomn C until colomn L
>> after hiding colomns F,G,H,I . Colomn headings are in row 6
Dave Peterson - 28 Dec 2007 23:47 GMT
Try recording a macro when you filter by any value--say ASDF.

Then change that ASDF to the cell that contains your string.

Selection.AutoFilter Field:=1, Criteria1:="=asdf", Operator:=xlAnd
becomes
Selection.AutoFilter Field:=1, _
  Criteria1:=worksheets("Sheet9999").range("a1").value

I'd use:
activesheet.autofilter.range.AutoFilter Field:=1, _
  Criteria1:=worksheets("Sheet9999").range("a1").value

> Can you specify a reference please??
>
[quoted text clipped - 22 lines]
> >> After that to print the filtered range starting colomn C until colomn L
> >> after hiding colomns F,G,H,I . Colomn headings are in row 6

Signature

Dave Peterson

Khalil Handal - 29 Dec 2007 15:52 GMT
Thanks Dave. It worked fine.
I also find something at Debra's website that also helped .

> Try recording a macro when you filter by any value--say ASDF.
>
[quoted text clipped - 38 lines]
>> >> L
>> >> after hiding colomns F,G,H,I . Colomn headings are in row 6

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.