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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Number stored as text beiung used in macro 1

Status
Not open for further replies.

SmithyJD

IS-IT--Management
Sep 23, 2004
52
GB
Hi I have a macro which is reading data from one work sheet and matching it to another however occasionally the user ends up the the source data as number stored as txt (its being filled in by some remote app) consequently when I come to use it in my macro it dont always match. Is the an equvalent way of taking the cell and converting it to numeric as using the Value(A1) option on a spreadsheet.

the macro statment doing this match is

Lrow = Application.WorksheetFunction.Match(Portfolio, Range("A:A"), 0)
On Error GoTo 0

Thanks in hope.

Jd
 
hi,
converting it to numeric
Code:
dim lRow as Variant
Lrow = Application.WorksheetFunction.Match(Val(Portfolio), Range("A:A"), 0)

if not iserror(lRow) then
   'actually found it!!!
else
   'actually found NOTHING
end if


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top