+ Reply to Thread
Results 1 to 12 of 12

Find and remove entire row

  1. #1
    Registered User
    Join Date
    08-14-2017
    Location
    Belgium
    MS-Off Ver
    365
    Posts
    48

    Find and remove entire row

    Hello all,

    I made a example of what I would like to have. (attached)

    If I fill in certain numbers in the tab "Sheet4" and press the "Remove" button, He will look for the numbers under DEU in tab DEU end if found, remove the entire row. If not found, continue with the next number. If there is no number, start with the MAC list,....

    Thanks a lot!
    Attached Files Attached Files

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,493

    Re: Find and remove entire row

    Possibly,
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    08-14-2017
    Location
    Belgium
    MS-Off Ver
    365
    Posts
    48

    Re: Find and remove entire row

    Hey,

    Good morning!

    This script works perfectly. I just need 1 more adaptation please.
    - The button and the items that have to be removed are in "Book1.xlsm", the lists where he has to remove the rows if found are in another file, lets say "Book2.xlsx".

    Thanks a lot!

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,493

    Re: Find and remove entire row

    Here it is.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-14-2017
    Location
    Belgium
    MS-Off Ver
    365
    Posts
    48

    Re: Find and remove entire row

    Hello,

    I adapted the code to the situation over here, but not working :/
    I get error 9, Subscript out of range, With Bk.Sheets(a.Value)

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    08-14-2017
    Location
    Belgium
    MS-Off Ver
    365
    Posts
    48

    Re: Find and remove entire row

    The original code is in "Greyson.xlsm" on tab Remove Dashboard
    The file where I want to delete the items are on file "Ref op AO SARI.xlsx", where I select the first tab before he starts (first tab is "DEU"

  7. #7
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,493

    Re: Find and remove entire row

    a.value has to match the sheet name.
    ThisWorkbook is the workbook you are running the code from

  8. #8
    Registered User
    Join Date
    08-14-2017
    Location
    Belgium
    MS-Off Ver
    365
    Posts
    48

    Re: Find and remove entire row

    Still not working.

    Can you pleeeeaaaase provide me the working code?
    I put it back in 1 workbook: Ref op AO Sari.xlsm

    Please Login or Register  to view this content.
    Attached Images Attached Images

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

    Re: Find and remove entire row

    Try
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    08-14-2017
    Location
    Belgium
    MS-Off Ver
    365
    Posts
    48

    Re: Find and remove entire row

    Still not working when I adapt the sheet names.

    I attached my final version (the normal list of numbers in the different tab are +10.000 each)

    So when you press the "remove" button, he should delete the complete row in the right tab (name of column = name of tab) for the test I used the word "test")

    Sombody able to fix the bugs I keep getting?

    Thanks!!!!

    This script will save us several hours of work each week!

    Thanks!
    Attached Files Attached Files

  11. #11
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,493

    Re: Find and remove entire row

    It's not a bug, you did not use the correct range.
    ......
    Can you pleeeeaaaase provide me the working code?
    I put it back in 1 workbook: Ref op AO Sari.xlsm
    Do you think we would give you a code that didn't work?
    -
    -
    -
    b2notb3.jpg

  12. #12
    Registered User
    Join Date
    08-14-2017
    Location
    Belgium
    MS-Off Ver
    365
    Posts
    48

    Re: Find and remove entire row

    First of all, I never wanted to say that your code had a bug. I know by adapting thinks I created the error. Really sorry for the misunderstanding.

    And thanks again for the tip. Changing the range did the trick

    Have a wonderful day!

+ 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] 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
  2. [SOLVED] Remove entire row macro
    By graiggoriz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-17-2012, 07:49 AM
  3. remove numbers in entire worksheet
    By sdrgac in forum Excel General
    Replies: 3
    Last Post: 04-04-2012, 02:42 PM
  4. Can I remove an entire line of data?
    By Ocean Zhang in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-01-2009, 12:44 AM
  5. Remove Dash from entire column
    By MC Advantages in forum Excel General
    Replies: 1
    Last Post: 01-15-2009, 01:33 PM
  6. Remove character from the entire row
    By mosellv in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-18-2007, 04:43 PM
  7. Remove Entire subtotal row will be deleted
    By NoelH in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-21-2006, 08:00 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