P
(PeteCresswell)
I'm scraping a spreadsheet.
User selects the whole sheet, does a Ctl-C, then I parse the copy
buffer.
For most of the numeric columns, I just do a Cdbl(columncontents)
and it's good to go. e.g. Cdbl("30,000") = 30000 and
Cdbl("$5.32") = 5.32.
However one column contains something called "SEC Fees" and the
users have it formatted so that if there is no fee, I wind up
trying to convert "$-" - which causes Cdbl() to choke.
Val() doesn't choke, but it truncates anything after a comma.
e.g. Val("$3,123.45") = 3
I guess I could wrap it in a couple of Replace() calls to get rid
of the offending minus sign and dollar sign - or, more likely,
write a function to strip out all offending characters once I
figure out what they are.
But I'm wondering if I'm missing something obvious - like some
other canned function.
?
User selects the whole sheet, does a Ctl-C, then I parse the copy
buffer.
For most of the numeric columns, I just do a Cdbl(columncontents)
and it's good to go. e.g. Cdbl("30,000") = 30000 and
Cdbl("$5.32") = 5.32.
However one column contains something called "SEC Fees" and the
users have it formatted so that if there is no fee, I wind up
trying to convert "$-" - which causes Cdbl() to choke.
Val() doesn't choke, but it truncates anything after a comma.
e.g. Val("$3,123.45") = 3
I guess I could wrap it in a couple of Replace() calls to get rid
of the offending minus sign and dollar sign - or, more likely,
write a function to strip out all offending characters once I
figure out what they are.
But I'm wondering if I'm missing something obvious - like some
other canned function.
?