Automatically populate more than one tab

wlbamc

Board Regular
Joined
Apr 19, 2016
Messages
99
Office Version
  1. 2016
Hi I am using the following code to automatically populate "LTC and CHC Panel Processes" tab when I complete the first tab, I also want this to automatically populate 2 other tabs, so 3 tabs in total when I complete the first 5 columns on the first tab any help gratefully received

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub

With Application
  .EnableEvents = False
  .ScreenUpdating = False
End With
Select Case Target.Column
  Case Is = 1
    Target.Copy
       Sheets("LTC and CHC Panel Processes").Range("A" & Rows.Count).End(xlUp)(2).PasteSpecial Paste:=xlPasteValues
       Target.Offset(, 1).Select
       
  Case Is = 2
    Target.Copy
       Sheets("LTC and CHC Panel Processes").Range("B" & Rows.Count).End(xlUp)(2).PasteSpecial Paste:=xlPasteValues
       Target.Offset(, 1).Select
       
  Case Is = 3
    Target.Copy
       Sheets("LTC and CHC Panel Processes").Range("C" & Rows.Count).End(xlUp)(2).PasteSpecial Paste:=xlPasteValues
       Target.Offset(, 1).Select
       
  Case Is = 4
    Target.Copy
       Sheets("LTC and CHC Panel Processes").Range("D" & Rows.Count).End(xlUp)(2).PasteSpecial Paste:=xlPasteValues
       Target.Offset(, 1).Select
       
  Case Is = 5
    Target.Copy
       Sheets("LTC and CHC Panel Processes").Range("E" & Rows.Count).End(xlUp)(2).PasteSpecial Paste:=xlPasteValues
       Target.Offset(, 1).Select
  
       
Case Else
    '
       
End Select

With Application
  .EnableEvents = True
  .CutCopyMode = False
  .ScreenUpdating = True
End With
End Sub
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
What are the names of the other 2 sheets?
 
Upvote 0
How about
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim ws As Worksheet
If Target.CountLarge > 1 Then Exit Sub

With Application
  .EnableEvents = False
  .ScreenUpdating = False
End With
   If Intersect(Target, Range("A:E")) Is Nothing Then Exit Sub
   For Each ws In Sheets(Array("LTC and CHC Panel Processes", "Discharge and transfer arrangem", "Other measures"))
      ws.Cells(Rows.Count, Target.Column).End(xlUp)(2).Value = Target.Value
   Next ws
   Target.Offset(, 1).Select

With Application
  .EnableEvents = True
  .ScreenUpdating = True
End With
End Sub
 
Upvote 0
Try:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Range("A:E")) Is Nothing Then Exit Sub
    Dim ws As Worksheet
    Dim LastRow As Long
    LastRow = ActiveSheet.Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
    With Application
      .EnableEvents = False
      .ScreenUpdating = False
    End With
    For Each ws In Sheets(Array("LTC and CHC Panel Processes", "Discharge", "transfer arrangem"))
        ws.Cells(ws.Rows.Count, Target.Column).End(xlUp).Offset(1, 0) = Target
    Next ws
    With Application
      .EnableEvents = True
      .CutCopyMode = False
      .ScreenUpdating = True
    End With
End Sub
It looks like Fluff beat me to it!! :)
 
Last edited:
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0
Hi I have put the code in which works perfectly for the first line but doesn't seem to work for any of the other lines on the sheet, any ideas please
 
Upvote 0
Do you mean it only works if you change a value on row1?
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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