Hi I am filtering a spread sheet with alist of cusips (alphanumeric codes) but I have one code which is purly numeric and everytime I run the filter It is there but leaves a black in the cell where the cusip is meant to appear.
Here is the code.
ublic Sub CreateFilteredCusipsResultsTable()
Const FILTER_SOURCE = "TABLE_RESULTS1"
Const FILTER_OUTPUT = "TABLE_RESULTS2"
Const FILTER_CRIT = "CUSIPS_FILTER"
Dim Destination As clsRange
Dim Crit As clsRange
'Initialise
Set Destination = New clsRange
Set Crit = New clsRange
'Adjust Criterian range to not include CUISP Count column
With Range(FILTER_CRIT)
Crit.Add .Resize(, .Columns.Count - 1), FILTER_CRIT
Crit.ConvertToPreciseDbaseCriterian
End With
'Setup Output range and perform advanced filter
With Destination
.Add FILTER_OUTPUT
.Range.CurrentRegion.Clear
modTools.PerformAdvancedFilter Range(FILTER_SOURCE), Crit.Range, .Range.Cells(1)
.ResetToCurrentRegion
.AddCompletionComment "Source:='" & FILTER_SOURCE & "' Crit:='" & FILTER_CRIT & "' Output:='" & .ID & "'"
End With
'Cleanup
Set Crit = Nothing
Set Destination = Nothing
End Sub
Does anyone have any ideas?
Faye
Here is the code.
ublic Sub CreateFilteredCusipsResultsTable()
Const FILTER_SOURCE = "TABLE_RESULTS1"
Const FILTER_OUTPUT = "TABLE_RESULTS2"
Const FILTER_CRIT = "CUSIPS_FILTER"
Dim Destination As clsRange
Dim Crit As clsRange
'Initialise
Set Destination = New clsRange
Set Crit = New clsRange
'Adjust Criterian range to not include CUISP Count column
With Range(FILTER_CRIT)
Crit.Add .Resize(, .Columns.Count - 1), FILTER_CRIT
Crit.ConvertToPreciseDbaseCriterian
End With
'Setup Output range and perform advanced filter
With Destination
.Add FILTER_OUTPUT
.Range.CurrentRegion.Clear
modTools.PerformAdvancedFilter Range(FILTER_SOURCE), Crit.Range, .Range.Cells(1)
.ResetToCurrentRegion
.AddCompletionComment "Source:='" & FILTER_SOURCE & "' Crit:='" & FILTER_CRIT & "' Output:='" & .ID & "'"
End With
'Cleanup
Set Crit = Nothing
Set Destination = Nothing
End Sub
Does anyone have any ideas?
Faye