Hi guys, I have these 2 Worksheet change events which im struggling to merge together, i know there can not be 2 on the same page, could I get a hand merging them onto the same event?
The purpose of this code is to copy and paste any values in sheet 1 typed in the b from tow 5 onwards column onto sheet 2 in the b column from row 5 onwards.
**********************************************************************
Private Sub Worksheet_Change(ByVal Target As Range)
' Exit if multiple cells updated at once
If Target.CountLarge > 1 Then Exit Sub
' See if update in column B after row 4
If Target.Column = 2 And Target.Row > 4 Then
Sheets("Sheet2").Range(Target.Address).Value = Target.Value
End If
End Sub
***********************************************************************
The purpose of this one is to sort all rows from B4 through to AA2000 from the value in K
***********************************************************************
Private Sub Worksheet_Change(ByVal Target As Range)
Range("B4:AA2000").Sort Key1:=Range("K4:K2000"), _
Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End Sub
***********************************************************************
Sorry.. amateur hour here. I got help from the forum for one of them and i've found the 2nd code online and adjusted it for what i need. just cant seem to merge them haha
The purpose of this code is to copy and paste any values in sheet 1 typed in the b from tow 5 onwards column onto sheet 2 in the b column from row 5 onwards.
**********************************************************************
Private Sub Worksheet_Change(ByVal Target As Range)
' Exit if multiple cells updated at once
If Target.CountLarge > 1 Then Exit Sub
' See if update in column B after row 4
If Target.Column = 2 And Target.Row > 4 Then
Sheets("Sheet2").Range(Target.Address).Value = Target.Value
End If
End Sub
***********************************************************************
The purpose of this one is to sort all rows from B4 through to AA2000 from the value in K
***********************************************************************
Private Sub Worksheet_Change(ByVal Target As Range)
Range("B4:AA2000").Sort Key1:=Range("K4:K2000"), _
Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End Sub
***********************************************************************
Sorry.. amateur hour here. I got help from the forum for one of them and i've found the 2nd code online and adjusted it for what i need. just cant seem to merge them haha