+ Reply to Thread
Results 1 to 10 of 10

Delete lines after a bullet

  1. #1
    Registered User
    Join Date
    07-07-2009
    Location
    San Francisco
    MS-Off Ver
    Excel 2003
    Posts
    16

    Delete lines after a bullet

    Hi,

    I am attempting to write a macro that given a range of cells goes into each cell and deletes the text after the first bullet. An example of this would be:

    The original cell contains:
    ---------------------
    • The company had revenues of $100 mm in 2008
    • The company is located in Mountainview, CA
    • The company CEO is Eric Schmidt
    ---------------------

    Upon executing the macro the cell is reformatted to:
    ---------------------
    • The company had revenues of $100 mm in 2008
    ---------------------

    Thanks in advance!
    Last edited by cdmcnamara; 07-07-2009 at 06:12 PM.

  2. #2
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208

    Re: Delete lines after a bullet

    Here is a procedure that would work. You would just need to replace A1:A10 with your specified range. It could also work on selected cells by changing Range("A1:A10") to Selection.

    Please Login or Register  to view this content.
    HTH,
    Jason

  3. #3
    Registered User
    Join Date
    07-07-2009
    Location
    San Francisco
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Delete lines after a bullet

    Jasoncw,

    That doesn't seem to be working, the cell remains the same way it was before. Does it make a difference that their are lines after each bullet point?

    The actual formatting is:
    ---------------------

    * The company had revenues of $100 mm in 2008

    * The company is located in Mountainview, CA

    * The company CEO is Eric Schmidt

    ---------------------

    Thanks in advance!

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Delete lines after a bullet

    Change Chr(13) to Chr(10)
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Registered User
    Join Date
    07-07-2009
    Location
    San Francisco
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Delete lines after a bullet

    That works if the first bullet is on the second line but there is a blank line prior to the first bullet, how can I account for this?

    Thanks in advanced!

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Delete lines after a bullet

    I dunno -- what do you want it to do?

    Posting a workbook with some examples and desired results would help.

  7. #7
    Registered User
    Join Date
    07-07-2009
    Location
    San Francisco
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Delete lines after a bullet

    Unfortunetly I can't post the workbook due to sensitive information but let me try and explain it better.

    So if this is the current cell:
    -------------------------
    *Blank Line*
    - The company ......

    - The company ......

    - The company ......
    *Blank Line*
    -------------------------

    The code with the chr(10) change works if the cell is formatted like:
    -------------------------
    - The company ......

    - The company ......

    - The company ......
    -------------------------

    Without the blank line at the top.

    The desired results would be that it removes everything after the first bullet point:
    -------------------------
    *Blank Line*
    - The company ......
    -------------------------

    Thanks in advance!

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Delete lines after a bullet

    What's the bullet character?

  9. #9
    Registered User
    Join Date
    07-07-2009
    Location
    San Francisco
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Delete lines after a bullet

    The character is: ■

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Delete lines after a bullet

    Please delete the sensitive data and post a workbook.
    Last edited by shg; 07-07-2009 at 07:34 PM.

+ 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