+ Reply to Thread
Results 1 to 7 of 7

Deleting names in between different sheets

  1. #1
    Registered User
    Join Date
    08-08-2024
    Location
    Rotterdam
    MS-Off Ver
    Office 365
    Posts
    3

    Lightbulb Deleting names in between different sheets

    In Sheet2 there are names in cells range B4:B15. I need to delete exactly the same names from Sheet1 if they are found in cells E4:E200. If it is possible, deleting the whole row where there the name is found would be also good. Dont have a clue how to start.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2407
    Posts
    25,974

    Re: Deleting names in between different sheets

    Welcome to the Forum Lukas36!

    Please try this with your file. If you have trouble then attach your file with sample data for testing.

    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    08-08-2024
    Location
    Rotterdam
    MS-Off Ver
    Office 365
    Posts
    3

    Re: Deleting names in between different sheets

    Hello 6StringJazzer,

    When I use the code above I get an Run-time error '9':

    Subscript out of range.


    I attached the file.

    Can you please advice? Thank you.
    Attached Files Attached Files
    Last edited by Lukas36; 08-08-2024 at 12:07 PM. Reason: Attachment

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2407
    Posts
    25,974

    Re: Deleting names in between different sheets

    It's because your sheets are not actually named Sheet1 and Sheet2 as in the description. I have updated the code to use the codenames, which are Sheet1 and Sheet2, instead of the tab names. It now works correctly.
    Attached Files Attached Files

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

    Re: Deleting names in between different sheets

    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 [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  6. #6
    Registered User
    Join Date
    08-08-2024
    Location
    Rotterdam
    MS-Off Ver
    Office 365
    Posts
    3

    Re: Deleting names in between different sheets

    Thank you. This works perfectly.

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 VersionVersion 2411 Win 11
    Posts
    24,409

    Re: Deleting names in between different sheets

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon (Next to Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ 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] Codes for Prevent users from adding sheets, deleting sheets, hiding/unhiding sheets
    By geniusufo007 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-13-2017, 11:57 PM
  2. Replies: 1
    Last Post: 10-06-2014, 09:44 AM
  3. Replies: 1
    Last Post: 09-03-2012, 10:52 PM
  4. Replies: 3
    Last Post: 02-11-2012, 08:34 AM
  5. Finding and deleting a small list of names from a really big list of names
    By vitalstatistix in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-07-2011, 01:31 PM
  6. Deleting sheets with local names - ver 2007 vs ver 2003
    By 1eyedjack in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-21-2010, 01:19 PM
  7. Deleting many sheets with similar names
    By conbre86 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-25-2007, 02:25 PM

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