Insert new row automatically if a row on another sheet is populated

YichGa

New Member
Joined
Jan 11, 2017
Messages
1
Hello everybody,

if you could please help me It would be much appreciated.

On the forum I found a code on this link that works great on my first sheet.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)   Dim rCell                       As Range
   Dim rDelete                     As Range
   If Not Intersect(Target, Range("RedBr").EntireColumn) Is Nothing Then


      Application.EnableEvents = False
      For Each rCell In Intersect(Target, Range("RedBr").EntireColumn).Cells


         If rCell.Row = Range("RedBr").Row - 1 Then
            If Len(rCell.Value) > 0 Then
               Range("RedBr").EntireRow.Insert
            Else
               If rDelete Is Nothing Then
                  Set rDelete = rCell
               Else
                  Set rDelete = Union(rDelete, rCell)
               End If
            End If
         ElseIf Len(rCell.Value) = 0 Then
            If rDelete Is Nothing Then
               Set rDelete = rCell
            Else
               Set rDelete = Union(rDelete, rCell)
            End If
         End If


      Next rCell
      If Not rDelete Is Nothing Then rDelete.EntireRow.Delete
      Application.EnableEvents = True


   End If
End Sub

I need to have the same data on another sheet in a different currency so could somebody please edit the code so that it also ads a new row on the second sheet when it adds a new row on the first sheet. The data is formatted as tables inside the sheets.

Thank you in advance,

YichGa
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Forum statistics

Threads
1,223,911
Messages
6,175,322
Members
452,635
Latest member
laura12345

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