+ Reply to Thread
Results 1 to 8 of 8

Select specific rows and delete

  1. #1
    Registered User
    Join Date
    07-16-2019
    Location
    sydney
    MS-Off Ver
    2013
    Posts
    2

    Select specific rows and delete

    Hi, Im new to this forum and VBA so appreciate any help here.

    I need a VBA script to do the following:
    - Find all rows that contain the word "Group"
    - Select these rows as well as the next row down wherever "Group" exists
    - Delete selected rows

    Thanks in advance

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Select specific rows and delete

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    07-16-2019
    Location
    sydney
    MS-Off Ver
    2013
    Posts
    2

    Re: Select specific rows and delete

    Hi, I've attached a workbook with a "before" and "after" tab of what Im trying to achieve. Thanks heaps.
    Attached Files Attached Files

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Select specific rows and delete

    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    Please Login or Register  to view this content.

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Select specific rows and delete

    Another Option...
    Please Login or Register  to view this content.
    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 star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Select specific rows and delete

    Please Login or Register  to view this content.

  7. #7
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Select specific rows and delete

    Or

    Please Login or Register  to view this content.

  8. #8
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Select specific rows and delete

    Or this...

    Please Login or Register  to view this content.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

+ 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. How to find specific work and delete next two rows also select range with specific words
    By priyadharshane in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-07-2019, 03:08 AM
  2. how to select only specific rows corresponding to a specific value in a column
    By valeria3 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-27-2018, 07:56 PM
  3. Delete All Rows Below Criteria in Col A / Then Delete Specific Rows in Col E
    By LennyC91 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-15-2016, 08:22 AM
  4. Replies: 4
    Last Post: 11-13-2013, 11:15 AM
  5. Replies: 1
    Last Post: 04-23-2007, 04:23 PM
  6. select and delete specific rows
    By Paulg in forum Excel General
    Replies: 1
    Last Post: 08-22-2006, 11:12 AM
  7. [SOLVED] Macro to select 4 entire rows and then delete rows
    By Scott Viney in forum Excel General
    Replies: 3
    Last Post: 09-22-2005, 03:05 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