Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default AutoFilter Pull Criteria from one sheet and custom filter on other

I'm trying to Custom Autofilter on a sheet by pulling the criteria from a
drop down list on another sheet. Here is how I have been trying to do it.

fi_mgr_num = Sheets("reports").Range("I6")
Selection.AutoFilter Field:=2, Criteria1:="=" & fi_mgr_num, Operator:=xlAnd

I don't have a clue if this is close, but I saw some of these ideas here on
the forum and have been trying various interations to make it work.

Any help would be appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default AutoFilter Pull Criteria from one sheet and custom filter on other

Hi DTG,

fi_mgr_num = Sheets("reports").Range("I6")
Selection.AutoFilter Field:=2, Criteria1:="=" & fi_mgr_num,
Operator:=xlAnd


This worked for me, provided that a cell in the autofilter range was
pre-selected.

If the first autofilter column only had a single criterion, you could
dispense with:

, Operator:=xlAnd

Did you try it and, if so, what problems did you experience?

---
Regards,
Norman



"dtg_denver" wrote in message
...
I'm trying to Custom Autofilter on a sheet by pulling the criteria from a
drop down list on another sheet. Here is how I have been trying to do it.

fi_mgr_num = Sheets("reports").Range("I6")
Selection.AutoFilter Field:=2, Criteria1:="=" & fi_mgr_num,
Operator:=xlAnd

I don't have a clue if this is close, but I saw some of these ideas here
on
the forum and have been trying various interations to make it work.

Any help would be appreciated.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default AutoFilter Pull Criteria from one sheet and custom filter on o

I'm not real sure what you are asking.

The range I'm trying to filter is on worksheet, "New", column "fi_mgr".

Do I need to have the macro select a cell on the "new" sheet in the "fi_mgr"
column?

"Norman Jones" wrote:

Hi DTG,

fi_mgr_num = Sheets("reports").Range("I6")
Selection.AutoFilter Field:=2, Criteria1:="=" & fi_mgr_num,
Operator:=xlAnd


This worked for me, provided that a cell in the autofilter range was
pre-selected.

If the first autofilter column only had a single criterion, you could
dispense with:

, Operator:=xlAnd

Did you try it and, if so, what problems did you experience?

---
Regards,
Norman



"dtg_denver" wrote in message
...
I'm trying to Custom Autofilter on a sheet by pulling the criteria from a
drop down list on another sheet. Here is how I have been trying to do it.

fi_mgr_num = Sheets("reports").Range("I6")
Selection.AutoFilter Field:=2, Criteria1:="=" & fi_mgr_num,
Operator:=xlAnd

I don't have a clue if this is close, but I saw some of these ideas here
on
the forum and have been trying various interations to make it work.

Any help would be appreciated.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default AutoFilter Pull Criteria from one sheet and custom filter on o

Hi DTG,

Do I need to have the macro select a cell on the "new" sheet in the
"fi_mgr"


No. Delections are rarely necessary an are usually to be avoided.

My comment related to tour code line:

Selection.AutoFilter Field:=2, Criteria1:="=" & fi_mgr_num,


With this syntax, an autofilter cell selection wouls be required.

The following does not requre any selection:

Sub Tester01()
Dim WB As Workbook
Dim RngFilter As Range
Dim fi_mgr_num As String

Set WB = ActiveWorkbook '<<==== CHANGE to suit
Set RngFilter = Sheets("New").AutoFilter.Range

fi_mgr_num = _
Sheets("Sheet3").Range("A1").Value '<<==== CHANGE to suit

RngFilter.AutoFilter Field:=1, Criteria1:=fi_mgr_num

End Sub


---
Regards,
Norman



"dtg_denver" wrote in message
...
I'm not real sure what you are asking.

The range I'm trying to filter is on worksheet, "New", column "fi_mgr".

Do I need to have the macro select a cell on the "new" sheet in the
"fi_mgr"
column?

"Norman Jones" wrote:

Hi DTG,

fi_mgr_num = Sheets("reports").Range("I6")
Selection.AutoFilter Field:=2, Criteria1:="=" & fi_mgr_num,
Operator:=xlAnd


This worked for me, provided that a cell in the autofilter range was
pre-selected.

If the first autofilter column only had a single criterion, you could
dispense with:

, Operator:=xlAnd

Did you try it and, if so, what problems did you experience?

---
Regards,
Norman



"dtg_denver" wrote in message
...
I'm trying to Custom Autofilter on a sheet by pulling the criteria from
a
drop down list on another sheet. Here is how I have been trying to do
it.

fi_mgr_num = Sheets("reports").Range("I6")
Selection.AutoFilter Field:=2, Criteria1:="=" & fi_mgr_num,
Operator:=xlAnd

I don't have a clue if this is close, but I saw some of these ideas
here
on
the forum and have been trying various interations to make it work.

Any help would be appreciated.






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default AutoFilter Pull Criteria from one sheet and custom filter on o

Norman,

This worked great. Thanks a million

Regards,
Mark

"Norman Jones" wrote:

Hi DTG,

Do I need to have the macro select a cell on the "new" sheet in the
"fi_mgr"


No. Delections are rarely necessary an are usually to be avoided.

My comment related to tour code line:

Selection.AutoFilter Field:=2, Criteria1:="=" & fi_mgr_num,


With this syntax, an autofilter cell selection wouls be required.

The following does not requre any selection:

Sub Tester01()
Dim WB As Workbook
Dim RngFilter As Range
Dim fi_mgr_num As String

Set WB = ActiveWorkbook '<<==== CHANGE to suit
Set RngFilter = Sheets("New").AutoFilter.Range

fi_mgr_num = _
Sheets("Sheet3").Range("A1").Value '<<==== CHANGE to suit

RngFilter.AutoFilter Field:=1, Criteria1:=fi_mgr_num

End Sub


---
Regards,
Norman



"dtg_denver" wrote in message
...
I'm not real sure what you are asking.

The range I'm trying to filter is on worksheet, "New", column "fi_mgr".

Do I need to have the macro select a cell on the "new" sheet in the
"fi_mgr"
column?

"Norman Jones" wrote:

Hi DTG,

fi_mgr_num = Sheets("reports").Range("I6")
Selection.AutoFilter Field:=2, Criteria1:="=" & fi_mgr_num,
Operator:=xlAnd

This worked for me, provided that a cell in the autofilter range was
pre-selected.

If the first autofilter column only had a single criterion, you could
dispense with:

, Operator:=xlAnd

Did you try it and, if so, what problems did you experience?

---
Regards,
Norman



"dtg_denver" wrote in message
...
I'm trying to Custom Autofilter on a sheet by pulling the criteria from
a
drop down list on another sheet. Here is how I have been trying to do
it.

fi_mgr_num = Sheets("reports").Range("I6")
Selection.AutoFilter Field:=2, Criteria1:="=" & fi_mgr_num,
Operator:=xlAnd

I don't have a clue if this is close, but I saw some of these ideas
here
on
the forum and have been trying various interations to make it work.

Any help would be appreciated.








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default AutoFilter Pull Criteria from one sheet and custom filter on o

I have two sheets I need to run this filter on. I thought once I had the
first sheet I could just repeat the process, but that doesn't seem to work.
The code works fine on the first sheet but not on the second. And it's not
throsing any errors.

Dim WB As Workbook
Dim RangeFilter As Range
Dim fi_mgr_num As String

Set WB = ThisWorkbook
Set RngFilter = Sheets("New").AutoFilter.Range

fi_mgr_num = Sheets("Reports").Range("K6").Value
RngFilter.AutoFilter Field:=2, Criteria1:=fi_mgr_num

Set WB = ThisWorkbook
Set RngFilter = Sheets("Used").AutoFilter.Range

fi_mgr_num = Sheets("Reports").Range("K12").Value
RngFilter.AutoFilter Field:=2, Criteria1:=fi_mgr_num


"dtg_denver" wrote:

Norman,

This worked great. Thanks a million

Regards,
Mark

"Norman Jones" wrote:

Hi DTG,

Do I need to have the macro select a cell on the "new" sheet in the
"fi_mgr"


No. Delections are rarely necessary an are usually to be avoided.

My comment related to tour code line:

Selection.AutoFilter Field:=2, Criteria1:="=" & fi_mgr_num,


With this syntax, an autofilter cell selection wouls be required.

The following does not requre any selection:

Sub Tester01()
Dim WB As Workbook
Dim RngFilter As Range
Dim fi_mgr_num As String

Set WB = ActiveWorkbook '<<==== CHANGE to suit
Set RngFilter = Sheets("New").AutoFilter.Range

fi_mgr_num = _
Sheets("Sheet3").Range("A1").Value '<<==== CHANGE to suit

RngFilter.AutoFilter Field:=1, Criteria1:=fi_mgr_num

End Sub


---
Regards,
Norman



"dtg_denver" wrote in message
...
I'm not real sure what you are asking.

The range I'm trying to filter is on worksheet, "New", column "fi_mgr".

Do I need to have the macro select a cell on the "new" sheet in the
"fi_mgr"
column?

"Norman Jones" wrote:

Hi DTG,

fi_mgr_num = Sheets("reports").Range("I6")
Selection.AutoFilter Field:=2, Criteria1:="=" & fi_mgr_num,
Operator:=xlAnd

This worked for me, provided that a cell in the autofilter range was
pre-selected.

If the first autofilter column only had a single criterion, you could
dispense with:

, Operator:=xlAnd

Did you try it and, if so, what problems did you experience?

---
Regards,
Norman



"dtg_denver" wrote in message
...
I'm trying to Custom Autofilter on a sheet by pulling the criteria from
a
drop down list on another sheet. Here is how I have been trying to do
it.

fi_mgr_num = Sheets("reports").Range("I6")
Selection.AutoFilter Field:=2, Criteria1:="=" & fi_mgr_num,
Operator:=xlAnd

I don't have a clue if this is close, but I saw some of these ideas
here
on
the forum and have been trying various interations to make it work.

Any help would be appreciated.






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
How do I filter for a blank cell, using custom autofilter Bee Jay Are Es Ay Excel Discussion (Misc queries) 3 April 3rd 23 07:00 PM
AutoFilter: custom filter hides all TomCat Excel Worksheet Functions 4 June 8th 09 11:51 AM
saving autofiltercustom filter settings Edwin199976 Excel Worksheet Functions 2 December 13th 06 06:52 PM
can custom autofilter pull parameters from other data? DaveCPA Excel Discussion (Misc queries) 0 September 28th 05 04:28 PM
Shortcut for Filter- Custom Autofilter Eileen Excel Discussion (Misc queries) 2 November 27th 04 01:09 PM


All times are GMT +1. The time now is 07:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"