G
George
Good Afternoon,
I have two worksheets, one named "Open Issues" and the other "Closed
Issues". In the code I've attached what happens is as soon as a completed
date is added to a cell row in "Open Issues" that row is then copied to the
next open row in the "Completed Issues" sheet and deleted from the "Open
Issues" and "Closed Issues" sheet is made active..
This is where I need help...Since the copied row is at the bottom, I need to
locate the last entry in lets say "Column L", delete its contents and make it
active for the user to input new information..
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim ws1 As Worksheet, ws2 As Worksheet
Dim lngRow As Long, lngNRow As Long
Set ws1 = ActiveSheet
Set ws2 = Worksheets("Closed issues")
lngNRow = ws2.Cells(Rows.Count, "H").End(xlUp).Row
For lngRow = ws1.Cells(Rows.Count, "H").End(xlUp).Row To 2 Step -1
If IsDate(ws1.Range("H" & lngRow)) Then
lngNRow = lngNRow + 1
ws1.Rows(lngRow).Copy ws2.Rows(lngNRow)
ws1.Rows(lngRow).Delete
ws2.Activate
End If
Next
End Sub
Thanks in advance
George
I have two worksheets, one named "Open Issues" and the other "Closed
Issues". In the code I've attached what happens is as soon as a completed
date is added to a cell row in "Open Issues" that row is then copied to the
next open row in the "Completed Issues" sheet and deleted from the "Open
Issues" and "Closed Issues" sheet is made active..
This is where I need help...Since the copied row is at the bottom, I need to
locate the last entry in lets say "Column L", delete its contents and make it
active for the user to input new information..
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim ws1 As Worksheet, ws2 As Worksheet
Dim lngRow As Long, lngNRow As Long
Set ws1 = ActiveSheet
Set ws2 = Worksheets("Closed issues")
lngNRow = ws2.Cells(Rows.Count, "H").End(xlUp).Row
For lngRow = ws1.Cells(Rows.Count, "H").End(xlUp).Row To 2 Step -1
If IsDate(ws1.Range("H" & lngRow)) Then
lngNRow = lngNRow + 1
ws1.Rows(lngRow).Copy ws2.Rows(lngNRow)
ws1.Rows(lngRow).Delete
ws2.Activate
End If
Next
End Sub
Thanks in advance
George