jacque
06-27-2018, 04:19 PM
I would like to sort data while typing. The data is in B7:C20, all other cells are locked. The sort should be based on column B only, which is the date.
I have the following Macro, but it does not work due to the locked cells.
Any help would be appreciated.
PrivateSub Worksheet_Change(ByVal Target As Range)
OnError Resume Next
IfNot Intersect(Target, Range("B:B")) Is Nothing Then
Range("B1").SortKey1:=Range("B2"), _
Order1:=xlAscending,Header:=xlYes, _
OrderCustom:=1,MatchCase:=False, _
Orientation:=xlTopToBottom
EndIf
End Sub
I have the following Macro, but it does not work due to the locked cells.
Any help would be appreciated.
PrivateSub Worksheet_Change(ByVal Target As Range)
OnError Resume Next
IfNot Intersect(Target, Range("B:B")) Is Nothing Then
Range("B1").SortKey1:=Range("B2"), _
Order1:=xlAscending,Header:=xlYes, _
OrderCustom:=1,MatchCase:=False, _
Orientation:=xlTopToBottom
EndIf
End Sub