0

When a cell is selected, I would like to timestamp the row and move it to another sheet?

Private Sub Worksheet_Change
On Error GoTo Handler
If Target.Column = 11 And Target.Value = "COMPLETE" Then
Application.EnableEvents = False
Target.Offset(0, 2) = Format(Now(), "mm-dd-yyyy hh:mm")
Application.EnableEvents = True
End If
Handler:


If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Columns(11)) Is Nothing Then
    If UCase(Target.Value) = "COMPLETE" Then
        Range("A" & Target.Row).Resize(1, 13).Copy Sheets("Closed Request").Cells(Rows.Count, 1).End(xlUp)(2)
        Target.EntireRow.Delete
    End If
End If


End Sub
Tom
  • 1
  • 1
  • I'm going to posit that there's no "automated" way to convert VBA to Office-js. As I understand it, it's a whole new paradigm. Having said that, I imagine it's possible to achieve the result you're after. Just that it needs to be built in Javascript/Typescript and it looks like there's quite a learning curve involved and not a lot of training resources around yet. – user9601310 Oct 14 '20 at 08:41
  • Thank you, I have been searching for information and training materials on this new process and you are correct, hardly any material on the subject. – Tom Oct 14 '20 at 12:31
  • Yes. It reminds me of the whole VB6/.Net saga where Microsoft alienated a whole generation of developers by making their existing environment obsolete at one stroke. Admittedly the writing's been on the wall for some time with VBA but the new cloud-based approach is, I suspect, a bridge too far for many current VBA developers. – user9601310 Oct 15 '20 at 09:13

0 Answers0