Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6974341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:13:28+00:00 2026-05-27T17:13:28+00:00

Say I have 2 sheets in my workbook. One is a master list that

  • 0

Say I have 2 sheets in my workbook. One is a master list that has a key column that is displayed only once as well as some other pertinent info. The other one has multiple items where the key could be listed hundreds of times.

What I want to do is when the row is deleted from the master sheet it deletes all rows that have the same key from the other sheet.

Is this possible?

Thanks,
Reg

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:13:29+00:00Added an answer on May 27, 2026 at 5:13 pm

    Let’s suppose there are two worksheets – the first is master that has all your unique keys and the second is named keys.

    Next, assume that data is set up as follows:

        **Master**                **Keys**
        A      B                   A      B  
    1   ABC1   other info...       ABC1   other info...
    2   ABC2   other info...       ABC1   other info...
    3   ABC3   other info...       ABC2   other info...
    4   ABC4   other info...       ABC2   other info...
    5   ABC5   other info...       ABC2   other info...
                                   ABC3   other info...
                                   ABC4   other info...
    

    If you select the key in master that you want to delete and run the following code this will delete the selected key from master and then loop through keys and delete any rows that have the same key:

    Sub DeleteKeys()
        Dim KeyID As String, KeysLastRow As Long, rw As Long
    
        KeyID = Selection.Value 
        KeysLastRow = Worksheets("keys").Range("A1").End(xlDown).Row //Get last row in `keys` column A
    
        Selection.EntireRow.Delete //Delete selected key (and row) in `master`
    
        With Worksheets("keys") //Loop through `keys` deleting all matching keys
            For rw = KeysLastRow To 1 Step -1
                If .Cells(rw, 1).Value = KeyID Then
                    .Cells(rw, 1).EntireRow.Delete
                End If
            Next rw
        End With
    End Sub
    

    Hope this helps you get started.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

lets say I have a xls sheet with just one column which has the
Lets say I have an Excel sheet such that: Column 1 contains salaries Column
Let's say we have a CCSprite object that has an actions tied to it:
Say I have a method that returns this. Vector[ (PkgLine, Tree) ]() I want
I have data stored in some column (Say, Column A). The length of Column
Maybe a silly question but here goes anyway. Example: Let's say I have one
I have a huge excel workbook that I've been developing to do some cost
I have four Excel sheets where i am having Movies list. i want to
lets say i have fallowing html... <li><a href=# id='DataSheets' >Data Sheets</a><font class=leftNavHitsFont>- (1)</font></li> <li><a
I have more than twenty sheets in an Excel workbook (file). Is there some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.