Delete String

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • felipebucaram
    New Member
    • Aug 2009
    • 8

    Delete String

    Hi, I'm using word an visual basic
    I'm makin an userform to paste an delete text.
    My question is: how do I delete a string? or a an entire line?

    Example:

    1) Passport delievred in 13/56/1978.
    2) Item 2 delievered in 24/12/1990.
    3) Item 3 delievered in 01/11/1985.
    4) Item 4 delievered in 01/11/2001.

    I want to delete the second line so that the result is this:

    1) Item 2 delievered in 24/12/1990.
    2) Item 4 delievered in 01/11/2001.
  • felipebucaram
    New Member
    • Aug 2009
    • 8

    #2
    It would be even better if I could cut the line, instead of deleting it, and paste it some where else in then document.

    Comment

    • kadghar
      Recognized Expert Top Contributor
      • Apr 2007
      • 1302

      #3
      i'd use SPLIT(yourstrin g, chr(13)) to make an array, where each index is a line
      then just write the lines you want to...

      ...or delete some indexes, and then use JOIN to have a string again.

      hth

      Comment

      Working...