Hi
I found this code on the site that more or less does what I want.
Rather than using the enter key to move cursor to next cell I want it to move based on a criteria for the data entered ie if cell is =>2 then move to next cell. If the value <1 then there would be a pop up message XXXXXX and would not move until cell update with new value that meets the 1st criteria. when say 9 cells have values entered in the row then the data is copied and pasted to sheet 2 row 1 as new dat added to sheet 1 this would need to have this row inserted for each time sheet 1 had data entered and the data in sheet 1 would be deleted making ready for next lot of data to be added etc, etc until finished the data entry
Eg values entered in cells a1 TO a9
data entered 2 (move), data entered 1 (popup) the value is updated to 10 (move), etc etc until A9 is reached then it is copied an pasted to sheet 2.
VBA Code found I want to update according to above or have a totally new code that will work
Thanks. I am just starting to use VBA and have little knowledge
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static oldCell As Range
If Not oldCell Is Nothing Then
Debug.Print oldCell.Address
Select Case oldCell.Address(0, 0)
'A1 => G5 => E3 => K10 => F2
Case "A1": sStr = "G5"
Case "G5": sStr = "E3"
Case "E3": sStr = "K10"
Case "K10": sStr = "F2"
Case "F2": sStr = "A1"
Case Else: sStr = ""
End Select
If sStr <> "" Then
Application.EnableEvents = False
Range(sStr).Select
Application.EnableEvents = True
End If
End If
Set oldCell = ActiveCell
End Sub
Bookmarks