Hello all!
I am using a workbook change event that moves data from one table to another on another sheet depending on a cells value.
Link to original query
This is working very well, however it is a workbook event which means for every sheet if a cell in row "O" is edited, row N is populated with data and every time row "B" is edited the macro attempts to move the row of any sheet. How can I make the workbook change event not happen for a specific sheet. I have a dashboard a the front of the workbook that I am currently avoiding putting anything in columns "B" and "O"
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Intersect(Target, Range("B:B,O:O")) Is Nothing Then Exit Sub
Application.EnableEvents = False
Dim bottomB As Long
Select Case Target.Column
Case Is = 2
bottomB = Sheets(Target.Value).Range("A:A").Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row + 1
Cells(Target.Row, 14).Value = Application.UserName & " " & Format(Now, "dd/mm/yyyy :") _
& " PROGRESSED TO STATUS " & Target.Value & vbNewLine & Cells(Target.Row, 14).Value
Range("A" & Target.Row).Resize(, 45).Copy Sheets(Target.Value).Cells(bottomB, 1)
Target.EntireRow.Delete
Case Is = 15
Target.Offset(0, -1).WrapText = True
Target.Offset(0, -1).Value = Application.UserName & " " & Format(Now, "dd/mm/yyyy :") _
& " " & Target.Value & vbNewLine & Target.Offset(0, -1).Value
Target.ClearContents
End Select
Application.EnableEvents = True
End Sub
Many thanks!
Bookmarks