Moving entire row to new sheet when date is entered

Foxy Lady

New Member
Joined
Feb 25, 2009
Messages
41
Hi there,

I wonder if any one can help me.

I want to move an entire row in spreadsheet A to the next empty line in Spreadsheet 2 if a date(any) is entered into column J.

Can this be done??

Regards

Foxylady
 
Hi peter,

Sorry for the delay.
Yes it is overwriting the row, instead of moving the second and next entries to a new row on the new sheet.

Is it posible that if I make a change in sheet on on that specific entry that it will also apply the change to sheet 2. For instance. If I change the date that the date also change in sheet 2 or if I delete the entrie that it will also delete the entrie in sheet 2

Awaiting you kind reponds.
Regards
 
Upvote 0

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Problem sorted, silly me.

When I change data in sheet one of rows that have already moved to sheet 2 it just add a new row in sheet 2. Is there anyway that the changes can be made to that specific row in sheet 2
 
Upvote 0
That isn't easy!

Is there something unique in one of the columns that can be used to match up the row on one sheet with a row on the other?
 
Upvote 0
Try

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Long, c As Integer, NextLineValue As Variant
Dim NR As Long, F As Range
r = Target.Row
c = Target.Column
If c = 1 Then
    Application.EnableEvents = False
    NextLineValue = Cells(r + 2, c)
    If NextLineValue = "Total" Then
        Rows(r + 1).Insert
    End If
    Application.EnableEvents = True
ElseIf c = 9 And IsDate(Target.Value) Then
    Set F = Sheets("Master").Columns("H").Find(what:=Range("H" & Target.Row).Value, LookIn:=xlValues, lookat:=xlWhole)
    If F Is Nothing Then
        NR = Sheets("Master").Range("A" & Rows.Count).End(xlUp).Offset(1).Row
    Else
        NR = F.Row
    End If
    Target.EntireRow.Copy Destination:=Sheets("Master").Range("A" & NR)
End If
End Sub
 
Upvote 0
Hi Peter
I have tried this code, but can't seem to get it to work.

I doesn't copy it to the next availible line but to row 33 in Prorisk.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Long, c As Integer, NextLineValue As Variant
Dim NR As Long, F As Range
r = Target.Row
c = Target.Column
If c = 1 Then
Application.EnableEvents = False
NextLineValue = Cells(r + 2, c)
If NextLineValue = "Total" Then
Rows(r + 1).Insert
End If
Application.EnableEvents = True
ElseIf c = 9 And IsDate(Target.Value) Then
Set F = Sheets("Master").Columns("H").Find(what:=Range("H" & Target.Row).Value, LookIn:=xlValues, lookat:=xlWhole)
If F Is Nothing Then
NR = Sheets("Master").Range("A" & Rows.Count).End(xlUp).Offset(1).Row
Else
NR = F.Row
End If
Target.EntireRow.Copy Destination:=Sheets("Master").Range("A" & NR)
End If (I have change master to prorisk)
End Sub</pre>
 
Upvote 0
Try

Rich (BB code):
Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Long, c As Integer, NextLineValue As Variant
Dim NR As Long, F As Range
r = Target.Row
c = Target.Column
If c = 1 Then
    Application.EnableEvents = False
    NextLineValue = Cells(r + 2, c)
    If NextLineValue = "Total" Then
        Rows(r + 1).Insert
    End If
    Application.EnableEvents = True
ElseIf c = 9 And IsDate(Target.Value) Then
    Set F = Sheets("Priorisk").Columns("H").Find(what:=Range("H" & Target.Row).Value, LookIn:=xlValues, lookat:=xlWhole)
    If F Is Nothing Then
        NR = Sheets("Priorisk").Range("A" & Rows.Count).End(xlUp).Offset(1).Row
    Else
        NR = F.Row
    End If
    Target.EntireRow.Copy Destination:=Sheets("Priorisk").Range("A" & NR)
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,238
Messages
6,170,939
Members
452,368
Latest member
jayp2104

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