+ Reply to Thread
Results 1 to 9 of 9

Deleting rows based on criteria

  1. #1
    Registered User
    Join Date
    06-03-2008
    Posts
    15

    Deleting rows based on criteria

    Hi there,

    I wonder whether you can help, I have a spreadsheet that has a number of sheets containing user names and data in rows.

    I currently have a front sheet with a marco that allows me to add a new user to all the sheets.

    However, every time I want to remove a user I need to go into each sheet and delete the row.

    If I type the name I want to delete on the front sheet, is there a marco that can copy the name from the front sheet find it in all the other sheet and delete the rows where the name appears?

    Thanks

    Mark

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,202
    Does the name always appear in the same Column?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    06-03-2008
    Posts
    15
    Yes, it does.

  4. #4
    Registered User
    Join Date
    06-12-2008
    Location
    Newbury
    MS-Off Ver
    Office 365 ProPlus
    Posts
    92
    I would do something like this, so even if the username is in a different column it will still find it.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-03-2008
    Posts
    15
    Thanks

    When you say "user name" can this be a cell reference? Or will this need to be an actual name?

  6. #6
    Registered User
    Join Date
    06-12-2008
    Location
    Newbury
    MS-Off Ver
    Office 365 ProPlus
    Posts
    92
    Either, you can place the username in the code or you could point it at a cell that contains the username like this:

    Please Login or Register  to view this content.
    The above would look for the username in cell A1 and you can change this to any cell you like.

  7. #7
    Registered User
    Join Date
    06-03-2008
    Posts
    15
    This works a treat, many thanks!!

    However, it does seem to delete the row on the front sheet where I input the name aswell. Is there anyway to omit a sheet?

    This is the code in action:-
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    06-12-2008
    Location
    Newbury
    MS-Off Ver
    Office 365 ProPlus
    Posts
    92
    Yep you can omit a sheet like this:

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    06-03-2008
    Posts
    15
    That's great!!

    Many thanks for your help!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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