Attribute VB_Name = "Foglio45"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True
Private Sub Worksheet_Change(ByVal Target As Range)
Dim run_number As Integer

'------------------------------------------------------
'Temperatures and pressures Enter
'------------------------------------------------------
For run_number = 1 To 12
If run_number = 1 Then
i = 7
Else: i = i + 14
End If
'-------------------
If Target.Address = Cells(i, 17).Address Then Cells(i, 18).Select 'temp
If Target.Address = Cells(i, 18).Address Then Cells(i + 4, 15).Select
'end of air temp
'-------------------
'purple sectors
If Target.Address = Cells(i, 22).Address Then Cells(i, 23).Select
If Target.Address = Cells(i, 23).Address Then Cells(i, 24).Select
If Target.Address = Cells(i, 24).Address Then Cells(i, 25).Select
If Target.Address = Cells(i, 25).Address Then Cells(i, 25).Select

If Target.Address = Cells(i + 4, 32).Address Then Cells(i + 4, 33).Select 'right blanking
If Target.Address = Cells(i + 4, 33).Address Then Cells(i + 4, 33).Select
'end of blanking
'-------------------
If Target.Address = Cells(i + 4, 15).Address Then Cells(i + 4, 17).Select
If Target.Address = Cells(i + 4, 17).Address Then Cells(i + 5, 15).Select
If Target.Address = Cells(i + 5, 15).Address Then Cells(i + 5, 17).Select
If Target.Address = Cells(i + 5, 17).Address Then Cells(i + 6, 14).Select
'end of cold pressures

'-------------------
If Target.Address = Cells(i + 6, 14).Address Then Cells(i + 6, 15).Select
If Target.Address = Cells(i + 6, 15).Address Then Cells(i + 6, 16).Select
If Target.Address = Cells(i + 6, 16).Address Then Cells(i + 6, 17).Select
If Target.Address = Cells(i + 6, 17).Address Then Cells(i + 6, 18).Select
If Target.Address = Cells(i + 6, 18).Address Then Cells(i + 6, 19).Select
If Target.Address = Cells(i + 6, 19).Address Then Cells(i + 7, 14).Select
If Target.Address = Cells(i + 7, 14).Address Then Cells(i + 7, 15).Select
If Target.Address = Cells(i + 7, 15).Address Then Cells(i + 7, 16).Select
If Target.Address = Cells(i + 7, 16).Address Then Cells(i + 7, 17).Select
If Target.Address = Cells(i + 7, 17).Address Then Cells(i + 7, 18).Select
If Target.Address = Cells(i + 7, 18).Address Then Cells(i + 7, 19).Select
If Target.Address = Cells(i + 7, 19).Address Then Cells(i + 8, 15).Select
'end of hot temps

'-------------------
If Target.Address = Cells(i + 8, 15).Address Then Cells(i + 8, 17).Select
If Target.Address = Cells(i + 8, 17).Address Then Cells(i + 9, 15).Select
If Target.Address = Cells(i + 9, 15).Address Then Cells(i + 9, 17).Select
If Target.Address = Cells(i + 9, 17).Address Then Cells(i + 11, 16).Select
'end of hot pressures

'-------------------
If Target.Address = Cells(i + 5, 21).Address Then Cells(i + 5, 22).Select
If Target.Address = Cells(i + 5, 22).Address Then Cells(i + 5, 23).Select
If Target.Address = Cells(i + 5, 23).Address Then Cells(i + 5, 24).Select
If Target.Address = Cells(i + 5, 24).Address Then Cells(i + 5, 25).Select
If Target.Address = Cells(i + 5, 25).Address Then Cells(i + 5, 27).Select
If Target.Address = Cells(i + 5, 27).Address Then Cells(i + 5, 29).Select
If Target.Address = Cells(i + 5, 29).Address Then Cells(i + 5, 30).Select
If Target.Address = Cells(i + 5, 30).Address Then Cells(i + 5, 31).Select
If Target.Address = Cells(i + 5, 31).Address Then Cells(i + 5, 32).Select

'end of temp & usos value



Next run_number

'------------------------------------------------------
'Sectors Enter
'------------------------------------------------------
If Columns("G").Hidden = False Then

For i = 1 To 300
    For j = 4 To 6
    If Target.Address = Cells(i, j).Address Then Cells(i, j + 1).Select
    Next j
Next i
For i = 7 To 300
    If Target.Address = Cells(i, 7).Address Then Cells(i + 1, 4).Select
Next i
End If

If Columns("G").Hidden = True Then

For i = 1 To 300
    For j = 4 To 5
    If Target.Address = Cells(i, j).Address Then Cells(i, j + 1).Select
    Next j
Next i
For i = 7 To 300
    If Target.Address = Cells(i, 6).Address Then Cells(i + 1, 4).Select
Next i
End If
'------------------------------------------------------
'Purple sector drivers in cap letters
'------------------------------------------------------
   If Not (Application.Intersect(Target, Range("V5:Y5,V19:Y19,V33:Y33,V47:Y47,V61:Y61,V75:Y75,V89:Y89,V103:Y103,V117:Y117,V131:Y131,V145:Y145,V159:Y159")) _
     Is Nothing) Then
       With Target
           If Not .HasFormula Then
               Application.EnableEvents = False
               .Value = UCase(.Value)
               Application.EnableEvents = True
           End If
       End With
   End If
    
End Sub

