+ Reply to Thread
Results 1 to 10 of 10

Search Based On Cell Contents - Delete Row on another Sheet

  1. #1
    Registered User
    Join Date
    01-27-2012
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2016, O365
    Posts
    97

    Search Based On Cell Contents - Delete Row on another Sheet

    Hi All,

    I am working on a project which is a form that is being filled out. Once its completed and saved on another tab (which I already have code for), I want the Macro to search on another sheet, for the contents of a cell on the form which changes after the form is completed each time. Once found on the other sheet, I want to delete the entire row. The search results will all be in column A on the second sheet.

    I have search everywhere and am not finding specifically what I need. I have tried recording a macro but the Macro looks for the same record over and over.

    I have attached a mock up of the spreadsheet.

    Any help you can provide would be greatly appreciated!

    Les (Excel 2013)
    Attached Files Attached Files

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Search Based On Cell Contents - Delete Row on another Sheet

    You say it only searchs in column A but if I understand you correctly there are more instances that may have the same value?
    Delete all of these?
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    01-27-2012
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2016, O365
    Posts
    97

    Re: Search Based On Cell Contents - Delete Row on another Sheet

    Thanks for the quick reply.

    On the sheet to be searched and deleted the record numbers will always be unique. The same number would also be on the archive data tab but I dont want that sheet searched. I would want to limit the search and delete to the all data worksheet.

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Search Based On Cell Contents - Delete Row on another Sheet

    This willdo it
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-27-2012
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2016, O365
    Posts
    97

    Re: Search Based On Cell Contents - Delete Row on another Sheet

    Strange. The macro runs, no errors but doesn't appear to do anything. Did it work for you?

  6. #6
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Search Based On Cell Contents - Delete Row on another Sheet

    Worked here on your file
    Is the nummer you’re searching for in d1 present?

  7. #7
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Search Based On Cell Contents - Delete Row on another Sheet

    Here's the file, check the sheet with the rows, return to Forms and press the smiley
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    01-27-2012
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2016, O365
    Posts
    97

    Re: Search Based On Cell Contents - Delete Row on another Sheet

    I'm an idiot. I edited it with my actual sheet names but missed updating the cell reference to D5 on my actual project.

    It worked! Thanks so much for your help!

    Les

  9. #9
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Search Based On Cell Contents - Delete Row on another Sheet

    You're welcome Les,
    No, not an idiot, just human, be happy with that
    Happy coding

  10. #10
    Registered User
    Join Date
    01-27-2012
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2016, O365
    Posts
    97

    Re: Search Based On Cell Contents - Delete Row on another Sheet

    haha will do

+ 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. Using cell contents to search for corresponding sheet title
    By teblowtime in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-30-2013, 03:31 PM
  2. Return Cell Contents by Sheet Name Search
    By gratedwasabi in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-26-2012, 10:45 PM
  3. Add and Delete Sheets based on contents of list located in the first sheet
    By gophins in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-09-2012, 03:50 PM
  4. Delete Rows Based On Cell Contents
    By aapke in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-28-2007, 08:14 PM
  5. Delete row based on contents of cell
    By AndyG in forum Excel General
    Replies: 6
    Last Post: 11-17-2005, 06:15 PM
  6. [SOLVED] Delete Row based on cell contents
    By Steph in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-01-2005, 04:09 PM
  7. [SOLVED] How do I conditionally delete rows based on cell contents?
    By CLR in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 06:05 AM
  8. How do I conditionally delete rows based on cell contents?
    By John Chan in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 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