+ Reply to Thread
Results 1 to 4 of 4

If cell starts with, add content to previous cell & delete row

  1. #1
    Registered User
    Join Date
    06-07-2021
    Location
    Belgium
    MS-Off Ver
    365
    Posts
    2

    If cell starts with, add content to previous cell & delete row

    Hi All,

    I have some problems with some data where sometimes the postal code & email address are in 1 row, sometimes seperated in two rows.

    I would like to fix it with a macro to always put them in a single row (with a line break). This is what I would like to do (example in the file attached, with those cell numbers)

    - If the cell starts with "E-mail:", let's say on row X --> go to previous row --> add line break & AX content to AX-1 --> delete AX row --> repeat until no row starts with "E-mail:"
    In my example, it's basically: Cell A10 starts with e-mail --> go to A9 --> add a line break and A10 content --> delete A10 row

    Of course, this should work for several hundreds of similar data.

    Thank you already for your help !
    Attached Files Attached Files

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: If cell starts with, add content to previous cell & delete row

    Try:
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    06-07-2021
    Location
    Belgium
    MS-Off Ver
    365
    Posts
    2

    Re: If cell starts with, add content to previous cell & delete row

    Works like a charm, thank a lot !

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: If cell starts with, add content to previous cell & delete row

    You are very welcome.

+ 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 delete a row if a column cell starts with X except for X0
    By SladeKaiser in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-23-2020, 07:42 PM
  2. [SOLVED] Delete All entire Rows in which Column A Cell value Not Starts with 1 or 2
    By abhinavbinkar in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-27-2018, 02:12 AM
  3. [SOLVED] Column shading and carrying cell content from previous cell (read for better explanation)
    By mainemojo in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-12-2018, 10:44 PM
  4. Replies: 4
    Last Post: 09-04-2014, 03:17 PM
  5. Auto-move previous content from cell a to cell b by changing cell a
    By Matt81a in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-21-2013, 03:32 PM
  6. [SOLVED] delete cell content when other cell's content is removed
    By Pretpik in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-11-2012, 11:06 PM
  7. [SOLVED] Delete row if cell starts with ...........
    By mohd21uk via OfficeKB.com in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 05-15-2006, 12:55 PM

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