PDA

View Full Version : extract text in strings



alienscript
08-02-2007, 01:47 AM
Hello VB experts,

I store my formula in cell B1. I almost already use up the maximum characters allowed in a spreadsheet cell. My macro to specifically trim the strings in column A runs until where the formula stops and there are some more criteria I need some VB code to continue with it. I am still a novice in Excel VB and I hope to get some help on this difficult problem I have.
Thanks very much in advance. With much gratitude!

matthewspatrick
08-02-2007, 05:19 AM
Your criterion #4 reads: "If strings begin with digit 0 to 9, erase only: all letters and characters (except 0 to 9 and hypen '-')".

Please clarify, then, what should happen to the string we see in B20 after running the commandbutton macro:

8808-11101, 88809-11102

A literal reading of your instructions would result in:

8808-1110188809-11102

Is that what you want?

alienscript
08-02-2007, 06:15 AM
Hello Matthews,

after removing the character ' , ' it should read as 8808-11101 88809-11102. I forgot to mention earlier that the space in the strings (except the left/right trim) must be in tact.

Thanks very very much Matt

alienscript
08-02-2007, 07:38 AM
Hello Matthews,

I added a column where the should-be output lies. I apologize I should have known earlier that way will give you a clearer idea of the criteria. Thanks again.

alienscript
08-03-2007, 09:36 PM
Hello Matthew,

I presume you have already come up with a code. Did you forget to reply? could you send to me please?

With much gratitude.