Move row then add a date

GWHarvey

New Member
Joined
Feb 6, 2019
Messages
6
I have a spreadsheet to track all of our projects so any new projects get entered in the "NewProject" sheet and from there when a particular letter is entered in column 12 then that row is moved (copied and deleted). This all works great.

My question is how can I add a date to another column, say column 13 (M). The problem is it puts the date on the last blank line which might not be the correct line. As shown in yellow

Newproject sheet:
[TABLE="width: 462"]
<tbody>[TR]
[TD="width: 97, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=F2F2F2]#F2F2F2[/URL] "]Project
[/TD]
[TD="width: 29, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=F2F2F2]#F2F2F2[/URL] , align: right"]Phase
[/TD]
[TD="width: 26, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=F2F2F2]#F2F2F2[/URL] , align: right"]Sub
[/TD]
[TD="width: 64, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=F2F2F2]#F2F2F2[/URL] "]Client
[/TD]
[TD="width: 54, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=F2F2F2]#F2F2F2[/URL] "]Type
[/TD]
[TD="width: 99, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=F2F2F2]#F2F2F2[/URL] "]Description
[/TD]
[TD="width: 38, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=F2F2F2]#F2F2F2[/URL] "]PM
[/TD]
[TD="width: 38, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=F2F2F2]#F2F2F2[/URL] "]Priority
[/TD]
[TD="width: 60, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=F2F2F2]#F2F2F2[/URL] "]Rec'ed Date
[/TD]
[TD="width: 60, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=F2F2F2]#F2F2F2[/URL] "]Deadline Date
[/TD]
[TD="width: 26, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=F2F2F2]#F2F2F2[/URL] "]Days Left
[/TD]
[TD="width: 26, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=F2F2F2]#F2F2F2[/URL] "]Start
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]000-00000-001
[/TD]
[TD="bgcolor: transparent"]000
[/TD]
[TD="bgcolor: transparent"]00
[/TD]
[TD="bgcolor: transparent"]Sample
[/TD]
[TD="bgcolor: transparent"]Sketch
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]GWH
[/TD]
[TD="bgcolor: transparent"]Rush
[/TD]
[TD="bgcolor: transparent, align: right"]02/06/19
[/TD]
[TD="bgcolor: transparent, align: right"]02/10/19
[/TD]
[TD="bgcolor: transparent"]4
[/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
</tbody>[/TABLE]

Precalc Sheet:
[TABLE="width: 519"]
<tbody>[TR]
[TD="width: 97, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=F2F2F2]#F2F2F2[/URL] "]Project
[/TD]
[TD="width: 29, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=F2F2F2]#F2F2F2[/URL] , align: right"]Phase
[/TD]
[TD="width: 26, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=F2F2F2]#F2F2F2[/URL] , align: right"]Sub
[/TD]
[TD="width: 64, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=F2F2F2]#F2F2F2[/URL] "]Client
[/TD]
[TD="width: 64, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=F2F2F2]#F2F2F2[/URL] "]Type
[/TD]
[TD="width: 104, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=F2F2F2]#F2F2F2[/URL] "]Description
[/TD]
[TD="width: 38, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=F2F2F2]#F2F2F2[/URL] "]PM
[/TD]
[TD="width: 38, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=F2F2F2]#F2F2F2[/URL] "]Priority
[/TD]
[TD="width: 60, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=F2F2F2]#F2F2F2[/URL] "]Rec'ed Date
[/TD]
[TD="width: 60, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=F2F2F2]#F2F2F2[/URL] "]Deadline Date
[/TD]
[TD="width: 26, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=F2F2F2]#F2F2F2[/URL] "]Days Left
[/TD]
[TD="width: 26, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=F2F2F2]#F2F2F2[/URL] "]Start
[/TD]
[TD="width: 60, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=F2F2F2]#F2F2F2[/URL] "]Precalc Rec'ed Date
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]111-11111-111
[/TD]
[TD="bgcolor: transparent"]000
[/TD]
[TD="bgcolor: transparent"]00
[/TD]
[TD="bgcolor: transparent"]Sample
[/TD]
[TD="bgcolor: transparent"]Siteplan
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]GWH
[/TD]
[TD="bgcolor: transparent"]Rush
[/TD]
[TD="bgcolor: transparent, align: right"]02/06/19
[/TD]
[TD="bgcolor: transparent, align: right"]02/10/19
[/TD]
[TD="bgcolor: transparent"]4
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: yellow, align: right"]02/06/19
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]000-00000-01
[/TD]
[TD="bgcolor: transparent"]000
[/TD]
[TD="bgcolor: transparent"]00
[/TD]
[TD="bgcolor: transparent"]Sample
[/TD]
[TD="bgcolor: transparent"]Sketch
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]GWH
[/TD]
[TD="bgcolor: transparent"]Rush
[/TD]
[TD="bgcolor: transparent, align: right"]02/06/19
[/TD]
[TD="bgcolor: transparent, align: right"]02/10/19
[/TD]
[TD="bgcolor: transparent"]4
[/TD]
[TD="bgcolor: transparent"]C
[/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
</tbody>[/TABLE]

Code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Columns(12)) Is Nothing Then
If UCase(Target.Value) = "C" Then
Range("A" & Target.Row).Resize(1, 12).Copy Sheets("Precalc").Cells(Rows.Count, 1).End(xlUp)(2)
Target.EntireRow.Delete
Sheets("Precalc").Cells(Rows.Count, 13).End(xlUp)(2) = Date

ElseIf UCase(Target.Value) = "F" Then
Range("A" & Target.Row).Resize(1, 12).Copy Sheets("Field").Cells(Rows.Count, 1).End(xlUp)(2)
Target.EntireRow.Delete

End If
End If
End Sub


I am not sure what to use instead of the xlup.

Thanks for any help
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Hi & welcome to MrExcel.
try
Code:
Sheets("Precalc").Cells(Rows.Count, 12).End(xlUp).Offset(, 1) = Date
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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