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

Hi I have 7 tables on one sheet. Each table has a column called "PROJECT".
When i apply a filter to table 1 how do i automatically apply the same filter
to the other tables. The filter applied will be to choose a project number
from 1 to 10.

Thanks in Advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Table Filters

I don't know of any way of triggering an event that will run the macro
automatically when the filter is applied to the first table. You will need to
provide a button to run the code.

The code permits custom filters with And/Or but it does not provide for
lists as can be filtered in xl2007.

The code assumes you have used the default table names of Table1, Table2,
Table3 etc otherwise it does not work in the loop.

Also assumes the tables are one under the other and not side by side because
when you filter entire rows are hidden; not just the row within the table.

Sub SetMatchingTableFilters()
Dim strHeader As String
Dim lngNumbTables As Long
Dim i As Long
Dim colNumber As Long
Dim rngHeader As Range
Dim varOperator As Variant
Dim varCriteria1 As Variant
Dim varCriteria2 As Variant

'Edit "Project" to your header name to find
strHeader = "Project"

'Edit 4 to the number of tables to process
lngNumbTables = 4

With ActiveSheet
'Find the Header name in the first table
Set rngHeader = .Range("Table1[#Headers]") _
.Find(What:=strHeader, _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)

'If found then set the column number
'of the header
If Not rngHeader Is Nothing Then
colNumber = rngHeader.Column
Else
MsgBox "No column named 'Project' in table1."
Exit Sub
End If

'Save the filter criteria applied to
'Table1
With .ListObjects("Table1") _
.AutoFilter.Filters(colNumber)

If .On Then
Select Case .Operator
Case 0
varOperator = 0
varCriteria1 = .Criteria1
Case xlAnd
varOperator = xlAnd
varCriteria1 = .Criteria1
varCriteria2 = .Criteria2
Case xlOr
varOperator = xlOr
varCriteria1 = .Criteria1
varCriteria2 = .Criteria2
End Select
Else
MsgBox "No filter set on table1"
Exit Sub
End If
End With

'Iterate through remaining tables and
'find the header column number and
'then set the filters
For i = 2 To lngNumbTables

'Find the column header name
Set rngHeader = _
.Range("Table" & i & "[#Headers]") _
.Find(What:=strHeader, _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)

'If header name found then
'set the column header number
'(Column number in table is same
'as filter number)
If Not rngHeader Is Nothing Then
colNumber = rngHeader.Column
Else
MsgBox "No column named 'Project' in Table " & i
Exit Sub
End If

'Set the criteria for the filter number.
'Simple filter with one selection
If varOperator = 0 Then
.ListObjects("Table" & i) _
.Range.AutoFilter Field:=colNumber, _
Criteria1:=varCriteria1
Else
'If custom filter with And/Or operator
'used in filter.
.ListObjects("Table" & i) _
.Range.AutoFilter Field:=colNumber, _
Criteria1:=varCriteria1, _
Operator:=varOperator, _
Criteria2:=varCriteria2
End If
Next i

End With

End Sub

--
Regards,

OssieMac

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Table Filters

Works fantastic.

Due to the fact that we cant trigger automatically, can we get user input to
choose the project number instead of using table 1. Will need an option to
show all projects.

Love your work.

"OssieMac" wrote:

I don't know of any way of triggering an event that will run the macro
automatically when the filter is applied to the first table. You will need to
provide a button to run the code.

The code permits custom filters with And/Or but it does not provide for
lists as can be filtered in xl2007.

The code assumes you have used the default table names of Table1, Table2,
Table3 etc otherwise it does not work in the loop.

Also assumes the tables are one under the other and not side by side because
when you filter entire rows are hidden; not just the row within the table.

Sub SetMatchingTableFilters()
Dim strHeader As String
Dim lngNumbTables As Long
Dim i As Long
Dim colNumber As Long
Dim rngHeader As Range
Dim varOperator As Variant
Dim varCriteria1 As Variant
Dim varCriteria2 As Variant

'Edit "Project" to your header name to find
strHeader = "Project"

'Edit 4 to the number of tables to process
lngNumbTables = 4

With ActiveSheet
'Find the Header name in the first table
Set rngHeader = .Range("Table1[#Headers]") _
.Find(What:=strHeader, _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)

'If found then set the column number
'of the header
If Not rngHeader Is Nothing Then
colNumber = rngHeader.Column
Else
MsgBox "No column named 'Project' in table1."
Exit Sub
End If

'Save the filter criteria applied to
'Table1
With .ListObjects("Table1") _
.AutoFilter.Filters(colNumber)

If .On Then
Select Case .Operator
Case 0
varOperator = 0
varCriteria1 = .Criteria1
Case xlAnd
varOperator = xlAnd
varCriteria1 = .Criteria1
varCriteria2 = .Criteria2
Case xlOr
varOperator = xlOr
varCriteria1 = .Criteria1
varCriteria2 = .Criteria2
End Select
Else
MsgBox "No filter set on table1"
Exit Sub
End If
End With

'Iterate through remaining tables and
'find the header column number and
'then set the filters
For i = 2 To lngNumbTables

'Find the column header name
Set rngHeader = _
.Range("Table" & i & "[#Headers]") _
.Find(What:=strHeader, _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)

'If header name found then
'set the column header number
'(Column number in table is same
'as filter number)
If Not rngHeader Is Nothing Then
colNumber = rngHeader.Column
Else
MsgBox "No column named 'Project' in Table " & i
Exit Sub
End If

'Set the criteria for the filter number.
'Simple filter with one selection
If varOperator = 0 Then
.ListObjects("Table" & i) _
.Range.AutoFilter Field:=colNumber, _
Criteria1:=varCriteria1
Else
'If custom filter with And/Or operator
'used in filter.
.ListObjects("Table" & i) _
.Range.AutoFilter Field:=colNumber, _
Criteria1:=varCriteria1, _
Operator:=varOperator, _
Criteria2:=varCriteria2
End If
Next i

End With

End Sub

--
Regards,

OssieMac

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Table Filters

With Microsoft still not providing automated notifications I missed checking
this earlier and I am a bit late getting back to you. I am periodically
checking my posts via my profile so I will eventually get back on all posts.

OK but need to confirm info regarding the list of projects.

Am I correct in assuming that you mean create a dropdown list by data
validation?

If yes to above, can you handle this?

if not, does Table1 contain all of the projects?

If not, do any of the tables contain all of the projects? (If so which one?)

If not then do you need code to create a unique list of the projects for the
dropdown validation? (It is done by gathering the entire list from all tables
and then Advanced Filter to create a unique list.)

In the mean time I will do some testing. don't anticipate any difficulties.

--
Regards,

OssieMac


"primed" wrote:

Works fantastic.

Due to the fact that we cant trigger automatically, can we get user input to
choose the project number instead of using table 1. Will need an option to
show all projects.

Love your work.

"OssieMac" wrote:

I don't know of any way of triggering an event that will run the macro
automatically when the filter is applied to the first table. You will need to
provide a button to run the code.

The code permits custom filters with And/Or but it does not provide for
lists as can be filtered in xl2007.

The code assumes you have used the default table names of Table1, Table2,
Table3 etc otherwise it does not work in the loop.

Also assumes the tables are one under the other and not side by side because
when you filter entire rows are hidden; not just the row within the table.

Sub SetMatchingTableFilters()
Dim strHeader As String
Dim lngNumbTables As Long
Dim i As Long
Dim colNumber As Long
Dim rngHeader As Range
Dim varOperator As Variant
Dim varCriteria1 As Variant
Dim varCriteria2 As Variant

'Edit "Project" to your header name to find
strHeader = "Project"

'Edit 4 to the number of tables to process
lngNumbTables = 4

With ActiveSheet
'Find the Header name in the first table
Set rngHeader = .Range("Table1[#Headers]") _
.Find(What:=strHeader, _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)

'If found then set the column number
'of the header
If Not rngHeader Is Nothing Then
colNumber = rngHeader.Column
Else
MsgBox "No column named 'Project' in table1."
Exit Sub
End If

'Save the filter criteria applied to
'Table1
With .ListObjects("Table1") _
.AutoFilter.Filters(colNumber)

If .On Then
Select Case .Operator
Case 0
varOperator = 0
varCriteria1 = .Criteria1
Case xlAnd
varOperator = xlAnd
varCriteria1 = .Criteria1
varCriteria2 = .Criteria2
Case xlOr
varOperator = xlOr
varCriteria1 = .Criteria1
varCriteria2 = .Criteria2
End Select
Else
MsgBox "No filter set on table1"
Exit Sub
End If
End With

'Iterate through remaining tables and
'find the header column number and
'then set the filters
For i = 2 To lngNumbTables

'Find the column header name
Set rngHeader = _
.Range("Table" & i & "[#Headers]") _
.Find(What:=strHeader, _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)

'If header name found then
'set the column header number
'(Column number in table is same
'as filter number)
If Not rngHeader Is Nothing Then
colNumber = rngHeader.Column
Else
MsgBox "No column named 'Project' in Table " & i
Exit Sub
End If

'Set the criteria for the filter number.
'Simple filter with one selection
If varOperator = 0 Then
.ListObjects("Table" & i) _
.Range.AutoFilter Field:=colNumber, _
Criteria1:=varCriteria1
Else
'If custom filter with And/Or operator
'used in filter.
.ListObjects("Table" & i) _
.Range.AutoFilter Field:=colNumber, _
Criteria1:=varCriteria1, _
Operator:=varOperator, _
Criteria2:=varCriteria2
End If
Next i

End With

End Sub

--
Regards,

OssieMac

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Table Filters

Hi,
No to data validation.
Yes Table 1 holds all the project numbers, but will hold multiple instances
of all the project numbers. It would be fine to presume there will be 10
projects. If i need more, i can edit the code.

Thanks for your help.

"OssieMac" wrote:

With Microsoft still not providing automated notifications I missed checking
this earlier and I am a bit late getting back to you. I am periodically
checking my posts via my profile so I will eventually get back on all posts.

OK but need to confirm info regarding the list of projects.

Am I correct in assuming that you mean create a dropdown list by data
validation?

If yes to above, can you handle this?

if not, does Table1 contain all of the projects?

If not, do any of the tables contain all of the projects? (If so which one?)

If not then do you need code to create a unique list of the projects for the
dropdown validation? (It is done by gathering the entire list from all tables
and then Advanced Filter to create a unique list.)

In the mean time I will do some testing. don't anticipate any difficulties.

--
Regards,

OssieMac


"primed" wrote:

Works fantastic.

Due to the fact that we cant trigger automatically, can we get user input to
choose the project number instead of using table 1. Will need an option to
show all projects.

Love your work.

"OssieMac" wrote:

I don't know of any way of triggering an event that will run the macro
automatically when the filter is applied to the first table. You will need to
provide a button to run the code.

The code permits custom filters with And/Or but it does not provide for
lists as can be filtered in xl2007.

The code assumes you have used the default table names of Table1, Table2,
Table3 etc otherwise it does not work in the loop.

Also assumes the tables are one under the other and not side by side because
when you filter entire rows are hidden; not just the row within the table.

Sub SetMatchingTableFilters()
Dim strHeader As String
Dim lngNumbTables As Long
Dim i As Long
Dim colNumber As Long
Dim rngHeader As Range
Dim varOperator As Variant
Dim varCriteria1 As Variant
Dim varCriteria2 As Variant

'Edit "Project" to your header name to find
strHeader = "Project"

'Edit 4 to the number of tables to process
lngNumbTables = 4

With ActiveSheet
'Find the Header name in the first table
Set rngHeader = .Range("Table1[#Headers]") _
.Find(What:=strHeader, _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)

'If found then set the column number
'of the header
If Not rngHeader Is Nothing Then
colNumber = rngHeader.Column
Else
MsgBox "No column named 'Project' in table1."
Exit Sub
End If

'Save the filter criteria applied to
'Table1
With .ListObjects("Table1") _
.AutoFilter.Filters(colNumber)

If .On Then
Select Case .Operator
Case 0
varOperator = 0
varCriteria1 = .Criteria1
Case xlAnd
varOperator = xlAnd
varCriteria1 = .Criteria1
varCriteria2 = .Criteria2
Case xlOr
varOperator = xlOr
varCriteria1 = .Criteria1
varCriteria2 = .Criteria2
End Select
Else
MsgBox "No filter set on table1"
Exit Sub
End If
End With

'Iterate through remaining tables and
'find the header column number and
'then set the filters
For i = 2 To lngNumbTables

'Find the column header name
Set rngHeader = _
.Range("Table" & i & "[#Headers]") _
.Find(What:=strHeader, _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)

'If header name found then
'set the column header number
'(Column number in table is same
'as filter number)
If Not rngHeader Is Nothing Then
colNumber = rngHeader.Column
Else
MsgBox "No column named 'Project' in Table " & i
Exit Sub
End If

'Set the criteria for the filter number.
'Simple filter with one selection
If varOperator = 0 Then
.ListObjects("Table" & i) _
.Range.AutoFilter Field:=colNumber, _
Criteria1:=varCriteria1
Else
'If custom filter with And/Or operator
'used in filter.
.ListObjects("Table" & i) _
.Range.AutoFilter Field:=colNumber, _
Criteria1:=varCriteria1, _
Operator:=varOperator, _
Criteria2:=varCriteria2
End If
Next i

End With

End Sub

--
Regards,

OssieMac



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Table Filters

"No to data validation" Then I need to know how you want to select the
project number and how you want to trigger the macro. Also need to know where
to get the filter value to use in the code.


--
Regards,

OssieMac


"primed" wrote:

Hi,
No to data validation.
Yes Table 1 holds all the project numbers, but will hold multiple instances
of all the project numbers. It would be fine to presume there will be 10
projects. If i need more, i can edit the code.

Thanks for your help.

"OssieMac" wrote:

With Microsoft still not providing automated notifications I missed checking
this earlier and I am a bit late getting back to you. I am periodically
checking my posts via my profile so I will eventually get back on all posts.

OK but need to confirm info regarding the list of projects.

Am I correct in assuming that you mean create a dropdown list by data
validation?

If yes to above, can you handle this?

if not, does Table1 contain all of the projects?

If not, do any of the tables contain all of the projects? (If so which one?)

If not then do you need code to create a unique list of the projects for the
dropdown validation? (It is done by gathering the entire list from all tables
and then Advanced Filter to create a unique list.)

In the mean time I will do some testing. don't anticipate any difficulties.

--
Regards,

OssieMac


"primed" wrote:

Works fantastic.

Due to the fact that we cant trigger automatically, can we get user input to
choose the project number instead of using table 1. Will need an option to
show all projects.

Love your work.

"OssieMac" wrote:

I don't know of any way of triggering an event that will run the macro
automatically when the filter is applied to the first table. You will need to
provide a button to run the code.

The code permits custom filters with And/Or but it does not provide for
lists as can be filtered in xl2007.

The code assumes you have used the default table names of Table1, Table2,
Table3 etc otherwise it does not work in the loop.

Also assumes the tables are one under the other and not side by side because
when you filter entire rows are hidden; not just the row within the table.

Sub SetMatchingTableFilters()
Dim strHeader As String
Dim lngNumbTables As Long
Dim i As Long
Dim colNumber As Long
Dim rngHeader As Range
Dim varOperator As Variant
Dim varCriteria1 As Variant
Dim varCriteria2 As Variant

'Edit "Project" to your header name to find
strHeader = "Project"

'Edit 4 to the number of tables to process
lngNumbTables = 4

With ActiveSheet
'Find the Header name in the first table
Set rngHeader = .Range("Table1[#Headers]") _
.Find(What:=strHeader, _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)

'If found then set the column number
'of the header
If Not rngHeader Is Nothing Then
colNumber = rngHeader.Column
Else
MsgBox "No column named 'Project' in table1."
Exit Sub
End If

'Save the filter criteria applied to
'Table1
With .ListObjects("Table1") _
.AutoFilter.Filters(colNumber)

If .On Then
Select Case .Operator
Case 0
varOperator = 0
varCriteria1 = .Criteria1
Case xlAnd
varOperator = xlAnd
varCriteria1 = .Criteria1
varCriteria2 = .Criteria2
Case xlOr
varOperator = xlOr
varCriteria1 = .Criteria1
varCriteria2 = .Criteria2
End Select
Else
MsgBox "No filter set on table1"
Exit Sub
End If
End With

'Iterate through remaining tables and
'find the header column number and
'then set the filters
For i = 2 To lngNumbTables

'Find the column header name
Set rngHeader = _
.Range("Table" & i & "[#Headers]") _
.Find(What:=strHeader, _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)

'If header name found then
'set the column header number
'(Column number in table is same
'as filter number)
If Not rngHeader Is Nothing Then
colNumber = rngHeader.Column
Else
MsgBox "No column named 'Project' in Table " & i
Exit Sub
End If

'Set the criteria for the filter number.
'Simple filter with one selection
If varOperator = 0 Then
.ListObjects("Table" & i) _
.Range.AutoFilter Field:=colNumber, _
Criteria1:=varCriteria1
Else
'If custom filter with And/Or operator
'used in filter.
.ListObjects("Table" & i) _
.Range.AutoFilter Field:=colNumber, _
Criteria1:=varCriteria1, _
Operator:=varOperator, _
Criteria2:=varCriteria2
End If
Next i

End With

End Sub

--
Regards,

OssieMac

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Table Filters

Select the project number through a popup message that gives you the option
of selecting project 1,2,3,4,5,6,7,8,9,10 or all. On close activate the code
to filter the tables to match the chosen project. I'll attach the popup to a
button on the page.

Regards

"OssieMac" wrote:

"No to data validation" Then I need to know how you want to select the
project number and how you want to trigger the macro. Also need to know where
to get the filter value to use in the code.


--
Regards,

OssieMac


"primed" wrote:

Hi,
No to data validation.
Yes Table 1 holds all the project numbers, but will hold multiple instances
of all the project numbers. It would be fine to presume there will be 10
projects. If i need more, i can edit the code.

Thanks for your help.

"OssieMac" wrote:

With Microsoft still not providing automated notifications I missed checking
this earlier and I am a bit late getting back to you. I am periodically
checking my posts via my profile so I will eventually get back on all posts.

OK but need to confirm info regarding the list of projects.

Am I correct in assuming that you mean create a dropdown list by data
validation?

If yes to above, can you handle this?

if not, does Table1 contain all of the projects?

If not, do any of the tables contain all of the projects? (If so which one?)

If not then do you need code to create a unique list of the projects for the
dropdown validation? (It is done by gathering the entire list from all tables
and then Advanced Filter to create a unique list.)

In the mean time I will do some testing. don't anticipate any difficulties.

--
Regards,

OssieMac


"primed" wrote:

Works fantastic.

Due to the fact that we cant trigger automatically, can we get user input to
choose the project number instead of using table 1. Will need an option to
show all projects.

Love your work.

"OssieMac" wrote:

I don't know of any way of triggering an event that will run the macro
automatically when the filter is applied to the first table. You will need to
provide a button to run the code.

The code permits custom filters with And/Or but it does not provide for
lists as can be filtered in xl2007.

The code assumes you have used the default table names of Table1, Table2,
Table3 etc otherwise it does not work in the loop.

Also assumes the tables are one under the other and not side by side because
when you filter entire rows are hidden; not just the row within the table.

Sub SetMatchingTableFilters()
Dim strHeader As String
Dim lngNumbTables As Long
Dim i As Long
Dim colNumber As Long
Dim rngHeader As Range
Dim varOperator As Variant
Dim varCriteria1 As Variant
Dim varCriteria2 As Variant

'Edit "Project" to your header name to find
strHeader = "Project"

'Edit 4 to the number of tables to process
lngNumbTables = 4

With ActiveSheet
'Find the Header name in the first table
Set rngHeader = .Range("Table1[#Headers]") _
.Find(What:=strHeader, _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)

'If found then set the column number
'of the header
If Not rngHeader Is Nothing Then
colNumber = rngHeader.Column
Else
MsgBox "No column named 'Project' in table1."
Exit Sub
End If

'Save the filter criteria applied to
'Table1
With .ListObjects("Table1") _
.AutoFilter.Filters(colNumber)

If .On Then
Select Case .Operator
Case 0
varOperator = 0
varCriteria1 = .Criteria1
Case xlAnd
varOperator = xlAnd
varCriteria1 = .Criteria1
varCriteria2 = .Criteria2
Case xlOr
varOperator = xlOr
varCriteria1 = .Criteria1
varCriteria2 = .Criteria2
End Select
Else
MsgBox "No filter set on table1"
Exit Sub
End If
End With

'Iterate through remaining tables and
'find the header column number and
'then set the filters
For i = 2 To lngNumbTables

'Find the column header name
Set rngHeader = _
.Range("Table" & i & "[#Headers]") _
.Find(What:=strHeader, _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)

'If header name found then
'set the column header number
'(Column number in table is same
'as filter number)
If Not rngHeader Is Nothing Then
colNumber = rngHeader.Column
Else
MsgBox "No column named 'Project' in Table " & i
Exit Sub
End If

'Set the criteria for the filter number.
'Simple filter with one selection
If varOperator = 0 Then
.ListObjects("Table" & i) _
.Range.AutoFilter Field:=colNumber, _
Criteria1:=varCriteria1
Else
'If custom filter with And/Or operator
'used in filter.
.ListObjects("Table" & i) _
.Range.AutoFilter Field:=colNumber, _
Criteria1:=varCriteria1, _
Operator:=varOperator, _
Criteria2:=varCriteria2
End If
Next i

End With

End Sub

--
Regards,

OssieMac

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Table Filters

OK in the 'Do/Loop While' section if you add the code between the asterisk
lines for a bit more validation. Tests for Cancel and also if user clicks OK
without entering anything. However, if user enters Al (or A or L) instead of
'All' then the validation does not capture it and the Instr function in the
Loop While sees it as valid and the filters are set to nothing. Could
possibly be validated by using a loop and individually comparing against each
element of the array but is it worth it?

Your other problem with Total. Not sure that I am interpreting your question
correctly but I assume that you do not want Total to be an option which is
reasonable considering what SubTotal function does. (I didn't consider it
initially because I did not have totals in my test tables but now I have
added them.)

Therefore in the Sub UniqueArray() replace the code that assigns the range
to the array so that the Resize reduces by - 2 rows instead of reduce by - 1
row.

With Range("Table1[[#All],[Project]]")
initArray = .Offset(1, 0) _
.Resize(.Rows.Count - 2, 1).Value
End With


--
Regards,

OssieMac


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Table Filters

Cheers,

Happy with the way it works.
Thanks for your help and promptness.

Regards
Primed

"primed" wrote:

Hi I have 7 tables on one sheet. Each table has a column called "PROJECT".
When i apply a filter to table 1 how do i automatically apply the same filter
to the other tables. The filter applied will be to choose a project number
from 1 to 10.

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
Pivot Table Filters Alex Mackenzie Excel Worksheet Functions 2 January 30th 09 09:54 PM
Pivot table and filters Mike Miller Excel Discussion (Misc queries) 0 October 8th 08 10:28 PM
Pivot Table filters, especially DATE filters chris Excel Worksheet Functions 0 August 27th 08 04:33 AM
Pivot Table Custom Filters Avi Excel Programming 0 September 15th 07 01:58 AM
Pivot table filters MLK Excel Discussion (Misc queries) 1 April 17th 07 07:20 PM


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