I have searched several times on this topic and found several similar situations but none that preserve integer and decimal values together. I have an HTML database that we run regular excel exports from. They export to a .xls file but in an html format, which I can easily fix. Some of the formatting is not correct as exported. I've got most of it figured out but there is one column that I'm having a great deal of trouble getting to work correctly. I'm fairly new to VBA commands in general but not a foreigner to scripting and language use.
This column is a dollar amount but it is not always entered strictly as a decimal value. Sometimes there are characters or comments thrown in with it. The easy option is to change the field's parameters from text to numeric value only; unfortunately not an option since the field type is set once it's made. I would have to create a new field with the same title and figure out how to transfer only the number values from all previous entries to the new field. It is (should be) simpler to just write a VBA to handle removal of everything except the numeric value of the currency, then convert formatting to currency format. The currency formatting is easy, I've got that part done. Getting the extra characters out of the mix is proving to be much more complex.
Here are some examples:
FIELD VALUE_____________DESIRED OUTPUT VALUE
__$49.76 (plus tax)_________$49.76
__253.99USD______________$253.99
__~50EUR (+s/h)___________$50.00
I'm not concerned with losing the EUR portion as that will also be handled elsewhere in the record entry and should never make it to this field as EUR anyway, but it occasionally happens. As long as the numbers can be extracted, including the decimal numbers where required, is good enough for my application. Every function I've tried thus far either returns a #VALUE error because of the text or does not produce the output I'm seeking.
I've attached a copy of the file for review. I've already converted it to excel format from the HTML export. The column in question is column I, "RFP Amount". Column J has some experimentation leftover that I was playing around with.
Bookmarks