When I delete a row from sheet A I want the same row be deleted in sheet B

odiseus

New Member
Joined
Aug 2, 2012
Messages
6
I have a workbook with 10 sheets. When I delete one row (any row - each time i choose which one to delete) in sheet A I would like the same row to be automatically deleted from sheet B. How can this be done?
TIA
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
If you are on sheet A, then hold shift and click on sheet B to select both sheets. Then delete the row you want to be gone and it will do it on both sheets.
 
Upvote 0
How about this?

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Range
Set r = Selection
If Selection.Columns.Count = ActiveSheet.Columns.Count Then
    Dim ws As Worksheet
        For Each ws In ActiveWorkbook.Worksheets
            If ws.Name <> "Sheet1" Then
                ws.Range(r.Address).EntireRow.Delete
            End If
        Next ws
End If
        
End Sub

substitute sheet1 for sheeta or whatever your main sheet is named.
 
Upvote 0
Thanks much again!
I am much less sophisticated...

Code:

Sub Macro1()
'
' Macro1 Macro
'
' Keyboard Shortcut: Ctrl+g
'
Sheets(Array("A", "B")).Select
Sheets("A").Activate
ActiveCell.EntireRow.Select
Selection.Delete
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,237
Messages
6,170,930
Members
452,367
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top