Hi,
I got some code from a previous thread and it has worked beautifully.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub 'multiple cells changed
If Not Intersect(Target, Range("A3:A300")) Is Nothing Then
Application.Goto Target.Offset(0, 2)
End If
If Not Intersect(Target, Range("C3:C299")) Is Nothing Then
Application.Goto Target.Offset(1, -2)
End If
End Sub
I tried to adapt it for another worksheet that I am creating but seem to keep getting an error.
This is how I changed it:
Private Sub Worksheet_change(ByVal target As Range)
'to move through appropriate cells
If target.Cells.Count > 1 Then Exit Sub 'multiple cells changed
If Not Intersect(target, Range("a3:a1000")) Is Nothing Then
Application.Goto target.Offset(0, 3)
End If
If Not Intersect(target, Range("d3:d1000")) Is Nothing Then
Application.Goto target.Offset(0, 2)
End If
If Not Intersect(target, Range("f3:f999")) Is Nothing Then
Application.Goto target.Offset(1, -5)
End If
It is Run-time error '1004':
application-defined of object-defined error
on the last line --Application.goto target.Offset(1, -5)
and it is not cycling through the cells, it is just going down to the next row.
I want to enter a number in A2 and have it go to cell D2, then F2 then A3 and so on after a value is entered in each cell.
Can anyone fix this for me please. Thanks in advance.
Bookmarks