+ Reply to Thread
Results 1 to 5 of 5

Delete Hard Return Alternatively with Delimiter.

  1. #1
    Registered User
    Join Date
    02-05-2012
    Location
    Hawaii
    MS-Off Ver
    Excel 2007 and 10
    Posts
    4

    Delete Hard Return Alternatively with Delimiter.

    Greetings to everyone. Im having this little problem to make a macro that would alternately delete a hard return with colon delimiter or separator after each deletion. Below is the sample data and the expected output.

    SAMPLE

    Location
    Sims Drive / Aljunied Road
    Site Area
    6,312.2 m2
    Allowable Development
    Business 1
    Maximum Gross Plot Ratio
    2.5
    Maximum Building Height
    64 m AMSL *
    Lease Period
    60 years

    EXPECTED RESULT

    Location: Sims Drive / Aljunied Road
    Site Area: 6,312.2 m2
    Allowable Development: Business 1
    Maximum Gross Plot Ratio: 2.5
    Maximum Building Height: 64 m AMSL *
    Lease Period: 60 years


    Thanks in advance

  2. #2
    Registered User
    Join Date
    01-26-2012
    Location
    Slovenia; Kranj
    MS-Off Ver
    Office 365
    Posts
    67

    Re: Delete Hard Return Alternatively with Delimiter.

    Hi,

    if you turn on Paragraph marks (¶) ... how does look mark at the end?

    Does look like ¶?
    Does look like 901125a.gif

    Does look same after each paragraph? Yes? than you have a problem

    If looks like 901125a.gif, than you can replace "^|" with ": ".
    If looks like ¶ you can replace "^p" with ": ".

    But it will replace all of them ... even those between "Sims Drive / Aljunied Road" and "Site Area" ... so at the end you'll get one line of text ... resolution is a macro ... but ... it is always 2nd paragraph which need to stay untouched, what is paragraph marker, ...


    Cheers, Marko

  3. #3
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Delete Hard Return Alternatively with Delimiter.

    In Word, use a wildcard Find/Replace, where:
    Find = (Location)?(*^13Site Area)?(*^13Allowable Development)?(*^13Maximum Gross Plot Ratio)?(*^13Maximum Building Height)?(*^13Lease Period)?(*^13)
    Replace = \1: \2: \3: \4: \5: \6: \7
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Delete Hard Return Alternatively with Delimiter.

    Please Login or Register  to view this content.



  5. #5
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Delete Hard Return Alternatively with Delimiter.

    Hi snb,

    You code needs more work - it joins the wrong lines and omits the required ': ' between expressions on the joined lines. Try:
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1