+ Reply to Thread
Results 1 to 6 of 6

Remove first lines in all cells in a column

  1. #1
    Registered User
    Join Date
    04-02-2015
    Location
    Auckland New Zealand
    MS-Off Ver
    2007
    Posts
    4

    Remove first lines in all cells in a column

    Does anyone know how to remove the first lines from each cell in 1 column (H) of a sheet of exported emails?
    excel lines in cell to be deleted @2017-05-30, 20_22_20.png
    Last edited by piecevcake; 05-30-2017 at 04:48 AM.

  2. #2
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Remove first lines in all cells in a column

    So many potential caveats, but this will work for the example provided (assuming input in cell H1)
    =RIGHT(H1,LEN(H1)-(FIND(CHAR(10),H1,FIND("To:",H1)+2)))

    Note, however, you lose the carriage returns in the original note, if any.
    Pauley
    --------
    If I helped with your issue, I'd appreciate a rep bump (hit the '*' icon to the bottom left of this post).

  3. #3
    Registered User
    Join Date
    04-02-2015
    Location
    Auckland New Zealand
    MS-Off Ver
    2007
    Posts
    4

    Re: Remove first lines in all cells in a column

    Thanks for that Pauley,
    Could you please help me with how to use that code?

    I was thinking of a VBA macro that would go through all the cells in the column, (but the site won't let me edit my question...)

  4. #4
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Remove first lines in all cells in a column

    It is not VBA code, it is a formula. So, in another cell, lets say Z1, put that formula in and then 'drag' that formula down to as many rows as you need.

  5. #5
    Registered User
    Join Date
    04-02-2015
    Location
    Auckland New Zealand
    MS-Off Ver
    2007
    Posts
    4

    Re: Remove first lines in all cells in a column

    ok... would I then paste values from the new column to the original column and the lines would be gone?

  6. #6
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Remove first lines in all cells in a column

    You could, have you tried it? As currently defined, if you put that formula into Z1, then H1 would remain unchanged, but Z1 would contain the text without the header info. You could then copy/cut the data from Z1 into H1 if you wish.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Macro to remove lines in Data set if Column A value is blank
    By sx200n in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-03-2017, 06:39 AM
  2. [SOLVED] Remove lines based on cell value (remove lines in range, not entire row)
    By Tapyr in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-27-2015, 07:31 AM
  3. Replies: 15
    Last Post: 06-30-2015, 02:36 AM
  4. [SOLVED] Macro neede to open text files from folder and remove all the lines except specific lines
    By genetist in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 10-07-2014, 02:44 AM
  5. How do I remove blank lines in the first column.
    By SWMagic in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 07-29-2013, 05:14 AM
  6. How to remove horizontal lines from inside table cells?
    By Reema in forum Word Formatting & General
    Replies: 4
    Last Post: 07-20-2009, 04:10 AM
  7. Remove lines without a value in column M?
    By Claude-Smith in forum Excel General
    Replies: 4
    Last Post: 09-05-2007, 09:51 AM

Tags for this Thread

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