Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help: disappearing numbers!

Status
Not open for further replies.

Fayeby

Programmer
Sep 16, 2002
7
CH
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
 
Hi,
Numeric value 1 and digit 1 (string value) are two different values.

Your data in the table ought to be stored as a string rather than numneric. Skip,
Skip@theofficeexperts.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top