Good day! I have an electronic class record with not less than 10 sheets. What I want to happen is that, when I insert row in first sheet, the same row will be inserted in the rest of the worksheets and when I delete a row, it will also be deleted in the rest of the sheets. I am not good in macro and barely understands codes. I tried the code below but it only add row in multiple sheets when I do a right-click. The problem is that when I delete a row in the first page, it do not delete in the rest of the sheets. Furthermore, I wish that the row inserted will copy the formula of the cells in the row where it is inserted. I hope anybody can help me. here's my code:
Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
Dim lngRow As Long
Dim ws As Worksheet
If Target.Column = 1 Then
Cancel = True
lngRow = ActiveCell.Row
For Each ws In Worksheets
Select Case ws.Name
Case "Sheet8", "Sheet9" 'adjust tabsheet names here to exclude sheets
'do Nothing
Case Else
ws.Rows(lngRow).Insert
End Select
Next ws
End If
End Sub
Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
Dim lngRow As Long
Dim ws As Worksheet
If Target.Column = 1 Then
Cancel = True
lngRow = ActiveCell.Row
For Each ws In Worksheets
Select Case ws.Name
Case "Sheet8", "Sheet9" 'adjust tabsheet names here to exclude sheets
'do Nothing
Case Else
ws.Rows(lngRow).Insert
End Select
Next ws
End If
End Sub