I'm having some issues here. I have two Private Sub Worksheet_Change that I need in one worksheet. I can't figure out how to make it work with both private subs. Below is my coding. Any ideas would be so helpful!!
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
' stanleydgromjr, 09/05/2011
' Version 3, after copying the Target.Row, delete the Target.Row
' http://www.excelforum.com/excel-programming/790860-move-entire-row-to-another-worksheet-based-on-cell-value.html
If Intersect(Target, Range("D:D")) Is Nothing Then Exit Sub
If Target.Count > 1 Then Exit Sub
If Target = "" Then Exit Sub
Dim P As Long, NR As Long
With Application
.EnableEvents = False
.ScreenUpdating = False
Select Case Target.Value
Case "Booked"
P = Application.Match("Potential", Worksheets("Booked").Columns(4), 0)
NR = Worksheets("Booked").Range("D" & P).End(xlUp).Offset(1).Row
Range("A" & Target.Row & ":J" & Target.Row).Copy Worksheets("Booked").Range("A" & NR)
Rows(Target.Row).Delete
Case "DNMQ"
P = Application.Match("Potential", Worksheets("DNMQ").Columns(4), 0)
NR = Worksheets("DNMQ").Range("D" & P).End(xlUp).Offset(1).Row
Range("A" & Target.Row & ":J" & Target.Row).Copy Worksheets("DNMQ").Range("A" & NR)
Rows(Target.Row).Delete
End Select
.EnableEvents = True
.ScreenUpdating = True
End With
End Sub
Private Sub Worksheet_Change1(ByVal Target As Range)
SetDateRow Target, "G"
'or
'SetDateCol Target, 5
End Sub
Sub SetDateRow(Target As Range, Col As String)
If Target.Cells.Count > 1 Then Exit Sub
Application.EnableEvents = False
Cells(Target.Row, Col) = Int(Now())
Application.EnableEvents = True
End Sub
Sub SetDateCol(Target As Range, Rw As Long)
If Target.Cells.Count > 1 Then Exit Sub
Application.EnableEvents = False
Cells(Rw, Target.Column) = Now()
Application.EnableEvents = True
End Sub
Bookmarks