G
Guest
I have the following code in my work book. It does exactly what I want it to
apart from each time a value is changed and the code runs the code scrolls
back through the entire sheet and as the number of rows is getting quite
extensive now this can take some time.
Does anyone have any idea how to stop this from happening.
Many thanks in advance
Mark Dullingham
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Application.Intersect(Range("b1:b150", "d1:d150"), Target) Is
Nothing Then
Range("D" & ActiveCell.Offset(-1, 0).Row & ":X" & ActiveCell.Offset(-1,
0).Row).Select
Selection.Replace what:="L??O???", _
Replacement:=Cells(ActiveCell.Row, "a").Value, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False
Target.Offset(1, 0).Select
End If
End Sub
apart from each time a value is changed and the code runs the code scrolls
back through the entire sheet and as the number of rows is getting quite
extensive now this can take some time.
Does anyone have any idea how to stop this from happening.
Many thanks in advance
Mark Dullingham
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Application.Intersect(Range("b1:b150", "d1:d150"), Target) Is
Nothing Then
Range("D" & ActiveCell.Offset(-1, 0).Row & ":X" & ActiveCell.Offset(-1,
0).Row).Select
Selection.Replace what:="L??O???", _
Replacement:=Cells(ActiveCell.Row, "a").Value, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False
Target.Offset(1, 0).Select
End If
End Sub