+ Reply to Thread
Results 1 to 2 of 2

How do I remove certain lines inside a cell with a macro?

  1. #1
    Registered User
    Join Date
    01-13-2010
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    1

    How do I remove certain lines inside a cell with a macro?

    Hi, please view this cell from a server log (also attached to this post):

    http://i.imgur.com/DEg9ZMO.gif

    I need to delete the extraneous lines that start with "Subject:", "Security ID:" et al but leave other lines intact like "Object name:"

    Also, I would like to copy certain lines to a new cell. "Object name:" and "Accesses:" should have their own column, obviously on the same row respective to the cell.

    Can someone clue me in to what keywords I should google to assemble this macro?

    thank you
    Attached Images Attached Images

  2. #2
    Registered User
    Join Date
    06-16-2016
    Location
    Greece
    MS-Off Ver
    2013
    Posts
    69

    Re: How do I remove certain lines inside a cell with a macro?

    Why do you need to have that sort of information in Excel? The cells aren't supposed to store text like that. However if it's something that you can't control,

    it's not hard. The line break character is CHAR(10). So search the string (use SEARCH or FIND) for CHAR(10) and after each occurence is a new line. Save the line to a new string and check if the first word is "Subject:" or what have you. If yes then remove the line using replace.

+ 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. Move lines inside cell to different cell
    By Generalist in forum Excel General
    Replies: 2
    Last Post: 02-15-2016, 10:29 AM
  3. [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
  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. [SOLVED] Macro to remove certain lines based on barcode format
    By ciuncky in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-10-2014, 07:38 AM
  6. Need help creating macro to add & remove lines on multiple sheets
    By gheffron in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-28-2011, 08:09 PM
  7. 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

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