+ Reply to Thread
Results 1 to 4 of 4

Delete two cells in a row based on value in first cell then shift remaining cells left

  1. #1
    Registered User
    Join Date
    05-02-2009
    Location
    Eagan, MN
    MS-Off Ver
    Excel 365
    Posts
    59

    Delete two cells in a row based on value in first cell then shift remaining cells left

    I have been struggling to find any examples on this.

    The attached worksheet has 20,000+ rows of information that I get daily. I have to remove the cell and it's corresponding cell based on the name in the first cell and shift everything left. Example in Row 2 I would need to remove the Name UPC and the corresponding cell with 85337239484 in it and shift the rest of the row left. To make it more interesting is some rows will have multiple items to be removed like in the 3rd row I have to remove MPN and Brand.

    These are the Names and corresponding cells I need to remove throughout the entire worksheet: SKU, MPN, UPC, Brand, Seller and SME.
    Attached Files Attached Files
    Last edited by MSchibs; 04-12-2022 at 08:46 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    01-07-2022
    Location
    Europe
    MS-Off Ver
    Office 365
    Posts
    473

    Re: Delete two cells in a row based on value in first cell then shift remaining cells left

    Try this (and test that it's not deleting any data it shouldn't before using it on live data)

    *** incorrect code removed - see next post ***
    Last edited by AskMeAboutExcel; 04-11-2022 at 10:41 PM.
    <<< If you have valued anyone's contributions in this thread, please click * to thank them for their efforts

  3. #3
    Valued Forum Contributor
    Join Date
    01-07-2022
    Location
    Europe
    MS-Off Ver
    Office 365
    Posts
    473

    Re: Delete two cells in a row based on value in first cell then shift remaining cells left

    oh sorry, missed the bit about the data in the corresponding cell. In that case, try

    Please Login or Register  to view this content.
    Last edited by AskMeAboutExcel; 04-11-2022 at 10:34 PM. Reason: third time lucky - step columns back from right to left to avoid skipping data

  4. #4
    Registered User
    Join Date
    05-02-2009
    Location
    Eagan, MN
    MS-Off Ver
    Excel 365
    Posts
    59

    Re: Delete two cells in a row based on value in first cell then shift remaining cells left

    That worked perfect, thank you.

+ 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. Delete and shift left a lot of cells
    By btbrennan81 in forum Excel General
    Replies: 2
    Last Post: 06-22-2016, 06:44 PM
  2. [SOLVED] Delete and shift remaining cells to the top.
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-01-2015, 10:54 AM
  3. [SOLVED] Delete all cells in each row except the last used cell then shift left all remaining data
    By dave033 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-16-2014, 09:33 AM
  4. [SOLVED] Conditional Delete Cells and shift to the left
    By markos97 in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 07-19-2013, 12:32 PM
  5. Macro to Remove Cells = 0 and Shift Remaining Cells on Row Left w/ One Condition
    By Mark V. in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-07-2013, 12:45 PM
  6. [SOLVED] Find cells which contain specific word, delete cells and shift left.
    By BPSJACK in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-24-2012, 07:00 AM
  7. Delete empty cells and shift remaining left
    By kiboodez in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-25-2010, 02:17 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