Duplicating changing columns to another sheet

jw3times

New Member
Joined
Apr 1, 2019
Messages
1
So I have a workbook which contains multiple sheets of tables similar to the ones below. In all the sheets, the first two columns (Name and Class) are always the same. The rest of the columns are always different. Whenever someone new comes along, or someone leaves, then I go in and add/delete their name from each sheet. I have eleven different sheets, so it becomes time consuming.

Is there anyway I can just copy all the values from the first sheet into the rest of them?

Naturally, I tried putting "=sheet1!A2" into the second sheet and dragging down. That works, until I insert/delete a row, which I'll be doing a lot of. Basically, if I insert a row between Jane and Juliet and designate them a Senior, I want those two columns to auto populate into all the other sheets, and have the other columns stay blank until I input something there.

I feel like this should be a simple solution, but I just can't figure anything out :confused:. Any help would be appreciated!


English Score
[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Class[/TD]
[TD]Fall '17[/TD]
[TD]Spring '18[/TD]
[TD]Fall '18[/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD]Freshman[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[/TR]
[TR]
[TD]Joe[/TD]
[TD]Sophomore[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[/TR]
[TR]
[TD]Peter[/TD]
[TD]Junior[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[/TR]
[TR]
[TD]Jane[/TD]
[TD]Junior[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[/TR]
[TR]
[TD]Juliet[/TD]
[TD]Senior[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[/TR]
</tbody>[/TABLE]



Math Score
[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Class[/TD]
[TD]Fall '17[/TD]
[TD]Spring '18[/TD]
[TD]Fall '18[/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD]Freshman[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[/TR]
[TR]
[TD]Joe[/TD]
[TD]Sophomore[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[/TR]
[TR]
[TD]Peter[/TD]
[TD]Junior[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[/TR]
[TR]
[TD]Jane[/TD]
[TD]Junior[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[/TR]
[TR]
[TD]Juliet[/TD]
[TD]Senior[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Mis-posted.
 
Last edited:
Upvote 0
This macro assumes that the sheet where you will be doing all your changes is named "English". Copy and paste this macro into the worksheet code module. Do the following: right click the tab name for your "English" sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Try adding/deleting data.
Code:
Dim lRowOld As Long
Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Range("B:B")) Is Nothing Then Exit Sub
    Dim actRow As Long, lRowNew As Long, ws As Worksheet, srcWS As Worksheet
    Set srcWS = Sheets("English")
    actRow = Target.Row
    lRowNew = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
    If lRowOld > lRowNew Then
        For Each ws In Sheets
            If ws.Name <> "English" Then
                ws.Rows(actRow).EntireRow.Delete
            End If
        Next ws
    lRowNew = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
    ElseIf lRowOld < lRowNew Then
        If Target.Row = lRowNew Then
            For Each ws In Sheets
                If ws.Name <> "English" Then
                    ws.Range("A2", ws.Range("A" & ws.Rows.Count).End(xlUp)).ClearContents
                    srcWS.Range("A2", srcWS.Range("A" & srcWS.Rows.Count).End(xlUp)).Resize(, 2).Copy ws.Cells(2, 1)
                End If
            Next ws
        Else
            For Each ws In Sheets
                If ws.Name <> "English" Then
                    ws.Rows(Target.Row).EntireRow.Insert
                End If
            Next ws
        End If
    Else
        For Each ws In Sheets
            If ws.Name <> "English" Then
                Target.Offset(0, -1).Resize(, 2).Copy ws.Range("A" & Target.Row)
            End If
        Next ws
    End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    lRowOld = Range("B" & Rows.Count).End(xlUp).Row
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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