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
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