I am currently building an excel template to be populated by a number of users.
I would like to be able to allow/restrict the cursor to move from current cell to the next relevant cell.
I did look at some code but it doesn't seem to be working for me. I placed this code directly on the relevant worksheet, from the sheets listed in 'objects', this is Sheet9(Recommendation Report), as the vba should only work within this worksheet.
I think part of my issue is that I already have this Worksheet Change object
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("H5")) Is Nothing Then
Exit Sub
Else: ActiveWorkbook.Save
End If
End Sub
I need that to remain intact, it is the first cell populated by the user and it saves the document allowing the sequential numbering vba to work for the next user, while the current user has the template file open.
The 2nd code I have looks like this
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Select Case Target.Address()
Case "$H$5"
Range("$H$6").Select
Case "$H$6"
Range("$N$5").Select
Case "$N$5"
Range("$N$6").Select
Case "$N$6"
Range("$Z$5").Select
Case "$Z$5"
Range("$D$10").Select
End Select
End Sub
This gave me the error 'Ambiguous name detected:Worksheet_Change' so I amended this by adding a '2' making it Private Sub Worksheet_Change2
but then that changes it from 'Worksheet' & 'Change' to 'General' & 'Worksheet_Change2'.
I am very new to VBA, can anyone help me string these 2 together, if that is possible, if not, any assistance on how better to perform this would be greatly appreciated.
Thanks in advance.