Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default Automatic filtering keystroke

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Automatic filtering keystroke

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
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




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
Repetitive keystroke Andre Croteau Excel Discussion (Misc queries) 3 October 7th 06 02:20 AM
Automatic Filtering sjamadok Excel Discussion (Misc queries) 3 September 22nd 06 04:47 PM
Automatic Filtering Mike Excel Worksheet Functions 0 July 26th 06 10:41 PM
Automatic filtering and coping result to a seperate sheet Richard P Excel Worksheet Functions 2 April 23rd 06 07:28 PM
Keystroke for Formatting AMaxwell Excel Worksheet Functions 1 February 13th 06 11:06 PM


All times are GMT +1. The time now is 11:58 PM.

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"