View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
DoctorG DoctorG is offline
external usenet poster
 
Posts: 106
Default Automatic filtering keystroke

Norman thanks a lot.
I am really in a hurry to try this out now but it looks simple enough. I
will even modify the Field:=3 to account for other columns so that I can
place this in Book.xls.


"Norman Jones" wrote:

Hi DoctorG.

Try assigning the following code to a button:

'=============
Public Sub Tester()
Dim sStr As String

sStr = ActiveCell.Value

Range("A1").AutoFilter Field:=3, Criteria1:=sStr
End Sub

'<<=============

---
Regards,
Norman



"DoctorG" wrote in message
...
I'm wondering if there is a keystroke that automatically applies a filter
according to the current cell contents.

That is, if my current cell is i.e. C155 and its contents are "My Bank
Expenses" and I want to filter out all lines with "My Bank Expenses" in
column C, instead of clicking on the column header (C1) filter button to
bring up the list box with all the values and then scroll all the way down
to
"My Bank Expenses", is there a Ctrl / Alt / whatever combination that
would
automatically apply the "My Bank Expenses" filter to column C according to
the contents of the currently selected cell??

Am I making sense here? I'm just looking for a shortcut.
Or should I write a routine of some sort and link it to a button? (Anyone
who is quick to say yes to the last question had better suggest some code
as
well!!!!)

Thanks in advance