Consulting

Results 1 to 5 of 5

Thread: extract text in strings

  1. #1

    extract text in strings

    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!

  2. #2
    VBAX Expert
    Joined
    Jul 2004
    Location
    Wilmington, DE
    Posts
    600
    Location
    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?
    Regards,

    Patrick

    I wept for myself because I had no PivotTable.

    Then I met a man who had no AutoFilter.

    Microsoft MVP for Excel, 2007 & 2008

  3. #3
    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

  4. #4
    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.

  5. #5
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •