• tab order (Excel 2003)

    Author
    Topic
    #406556

    I have a spreadsheet that is essentially a calendar- Jan to June on the left and July to December on the right. I have protected it so that I can only tab to the cells that I want. I have one minor problem. Normally I tab from B1 to H1 (Monday to Sunday). I want to tab from H1 to B2 not to K1 which is in July. How do I change the end of week tab order? I have been unsuccessful in looking this up.

    Thanks

    Fred

    Viewing 1 reply thread
    Author
    Replies
    • #844073

      If you don’t mind not ever being able to select a cell in column I, then you could use the code below in the worksheet selection change event routine:

      Private Sub Worksheet_SelectionChange(ByVal Target As Range)
          If Not Intersect(Target, Range("I:I")) Is Nothing Then
              Application.EnableEvents = False
              Range("A" & Target.Row + 1).Select
              Application.EnableEvents = True
          End If
      End Sub
      
      • #844079

        I think what you are telling me is that there is not the simple solution that I had hoped for. Right now your solution is beyond my knowledge to implement. This is not earth shattering. I will live with things as they are now.

        Thank you for your effort. I hope that in a relatively short time my knowledge will catch up with your solution.

        • #844091

          Legare’s solution is surprisingly simple to implement; right click the worksheet tab, select View Code, and paste the code in there, then save the workbook. Give it a try!

          Is it correct that your layout is Sun – Sat for the Jan – June in Columns B:H and then Sun – Sat for July – Dec is in Columns J:P? A similar solution to Legares’ would be to protect all cells except in those columns, protect the sheet, and then use code like this, entered the same way:

          Private Sub Worksheet_SelectionChange(ByVal Target As Range)
          If ActiveCell.Column = 9 Or ActiveCell.Column = 17 Then _
          ActiveCell.Offset(1, -7).Activate
          End Sub

          But you’d have to Click into a day in the second set of months to get into those July – December columns.

        • #844092

          Legare’s solution is surprisingly simple to implement; right click the worksheet tab, select View Code, and paste the code in there, then save the workbook. Give it a try!

          Is it correct that your layout is Sun – Sat for the Jan – June in Columns B:H and then Sun – Sat for July – Dec is in Columns J:P? A similar solution to Legares’ would be to protect all cells except in those columns, protect the sheet, and then use code like this, entered the same way:

          Private Sub Worksheet_SelectionChange(ByVal Target As Range)
          If ActiveCell.Column = 9 Or ActiveCell.Column = 17 Then _
          ActiveCell.Offset(1, -7).Activate
          End Sub

          But you’d have to Click into a day in the second set of months to get into those July – December columns.

      • #844080

        I think what you are telling me is that there is not the simple solution that I had hoped for. Right now your solution is beyond my knowledge to implement. This is not earth shattering. I will live with things as they are now.

        Thank you for your effort. I hope that in a relatively short time my knowledge will catch up with your solution.

    • #844074

      If you don’t mind not ever being able to select a cell in column I, then you could use the code below in the worksheet selection change event routine:

      Private Sub Worksheet_SelectionChange(ByVal Target As Range)
          If Not Intersect(Target, Range("I:I")) Is Nothing Then
              Application.EnableEvents = False
              Range("A" & Target.Row + 1).Select
              Application.EnableEvents = True
          End If
      End Sub
      
    Viewing 1 reply thread
    Reply To: tab order (Excel 2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: