I was wondering if it is possible to automatically add a row of information to one tab after it has been added to a different tab?
For instance i have been copying and pasting a single row from multiple spreadsheets into a tab on a master one. The next tab is linked to the first, with information pulled out from each row (the same data each time).
Other people will be updating the first tab with further rows and i want the second tab to recognise that data has been added to the first tab and update itself accordingly. (So i don't have to go into the tab, hightlight a row and use autofill each time).
Last edited by Riosmitham; 01-12-2011 at 05:52 AM.
Lacking the specific about the worksheets, here is the basic code to get you started.
This code uses sheet code names -- not worksheet (tab) names. You may need to revise the sheet code names and certainly the range references.Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) Dim nextrow As Long nextrow = Sheet2.Cells(Rows.Count, "A").End(xlUp).Row + 1 If Target.Cells.Count > 1 Then Exit Sub Application.ScreenUpdating = False If Not Intersect(Target, Range("G1:G100")) Is Nothing Then Range(Cells(Target.Row, "A"), Cells(Target.Row, "G")).Copy Sheet2.Range("A" & nextrow) End If Application.CutCopyMode = False Application.ScreenUpdating = True End Sub
The code works as follows:
Column-G is the "last" entry column. When a cell in the range of G1:G100 is changed, the range of cells from A:G, for that row, are copied to Sheet2.
This code must be placed in the module of the worksheet in which you are entering the data.
How to add the code
- Right-click the sheet tab of the target sheet, choose View Code
- Copy and paste the code into the VB Editor
- Make any necessary changes to sheet and range references
- Close the VB Editor
Palmetto
Do you know . . . ?
You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.
Thanks for your help but this code won't work for me because i only want to select certain columns and reaarange them on the second sheet. To solve this i have simply autofilled for 1000 rows and they will update automatically, it just looks messy because i end up with loads of 0s and #VALUE!s. It's not a major issue though.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks