+ Reply to Thread
Results 1 to 9 of 9

Macro that extracts rows from one sheet to another based on cell content

  1. #1
    Registered User
    Join Date
    04-03-2017
    Location
    Denmark
    MS-Off Ver
    365
    Posts
    94

    Macro that extracts rows from one sheet to another based on cell content

    I'm looking for a macro that extracts rows from SHEET1 (without deleting them) and puts them into SHEET2 based on the contents of the cells in column H. In addition it should delete columns containing the words HHA, HHB or HHC in ROW 4 in the newly created SHEET2.

    How is this possible with a macro?

    Thanks in advance!
    Last edited by Allerdrengen; 07-06-2017 at 07:57 AM.

  2. #2
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,955

    Re: Macro that extracts rows from one sheet to another based on cell content

    Hi Allerdrengen
    based on the contents of the cells in column H
    What is the criteria?
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    04-03-2017
    Location
    Denmark
    MS-Off Ver
    365
    Posts
    94

    Re: Macro that extracts rows from one sheet to another based on cell content

    Hello

    If the word "Rotant" is present

  4. #4
    Registered User
    Join Date
    04-03-2017
    Location
    Denmark
    MS-Off Ver
    365
    Posts
    94

    Re: Macro that extracts rows from one sheet to another based on cell content

    Just a correction. The columns to be deleted should also be based on cell contents for ROW 4

  5. #5
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,955

    Re: Macro that extracts rows from one sheet to another based on cell content

    The columns to be deleted should also be based on cell contents for ROW 4
    And that is.............................

  6. #6
    Registered User
    Join Date
    04-03-2017
    Location
    Denmark
    MS-Off Ver
    365
    Posts
    94

    Re: Macro that extracts rows from one sheet to another based on cell content

    If a cell in row 4 contains either HHA, HHB or HHC, it should delete the entire column.

  7. #7
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,955

    Re: Macro that extracts rows from one sheet to another based on cell content

    Gonna have to be more specific....The code needs to be written to accommodate...
    Row in which sheet....
    Which column is the cell in.....
    it should delete the entire column
    referring to Columns F,O,P

  8. #8
    Registered User
    Join Date
    04-03-2017
    Location
    Denmark
    MS-Off Ver
    365
    Posts
    94

    Re: Macro that extracts rows from one sheet to another based on cell content

    SHEET2 should extract the ROWS from SHEET1 that contains the word "Rotants" in its corresponding cell in column H. Then the code should delete all columns containing the words "HHA", "HHB" or "HHC" in its corresponding cell in ROW 4 (This step happens in SHEET2).

    Hope it clears it up

  9. #9
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,955

    Re: Macro that extracts rows from one sheet to another based on cell content

    If I understand correctly....
    For each cell in Sheet2.Row4 If cell contains words "HHA", "HHB" or "HHC" then that column that cell is in must be deleted....
    Ideally you should upload a sample file so that we can test our code on...

    Please Login or Register  to view this content.

+ 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] Automatically Transfer Rows from One Sheet to Another Based on Cell Content
    By mjohnson48 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-29-2016, 04:58 PM
  2. Replies: 2
    Last Post: 09-22-2014, 12:52 PM
  3. [SOLVED] Find rows to delete with a macro based on cell content
    By mkraffert in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-28-2013, 06:27 PM
  4. [SOLVED] Macro/VBA to Change Order of Rows/Add Rows based on specific text content presence/absence
    By cmaunder in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-07-2013, 04:50 PM
  5. Replies: 3
    Last Post: 06-24-2011, 03:00 AM
  6. Replies: 0
    Last Post: 02-02-2011, 06:42 PM
  7. Copy rows based on content from one sheet to another
    By kaitlyn0905 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-13-2005, 08:28 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