Jenamande10
Messages postés8Date d'inscriptionlundi 23 juin 2014StatutMembreDernière intervention27 juin 2014
-
27 juin 2014 à 13:28
Jenamande10
Messages postés8Date d'inscriptionlundi 23 juin 2014StatutMembreDernière intervention27 juin 2014
-
27 juin 2014 à 13:48
Bonjour,
Je suis en train de finaliser un code sur vba et j'ai cette erreur qui ne fait que venir me pertuber. C'est la première fois que je la vois alors je ne sais pas trop quoi faire. J'ai bien regarder le code et arranger les synthaxes bancales, mais rien à faire. Quelqu'un aurait un avis s'il vous plait? Je suis désespérée sur ce coup là...
Le but c'est d'avoir des calcul de Init0 et Fin0 en fonction des valeurs de Xo et Yo.
Le code se présente comme suit:
Option Explicit
Sub Tanks()
Dim Caire As String
Dim Xo As Long
Dim Yo As Long
Dim heur As Date
Dim hora As Date
Dim densite As Double
Dim Init0 As Long
Dim Fin0 As Long
Dim debit As Double
Caire = Sheets("Tanks").Range("C4").Value
Xo = Sheets("Tanks").Range("C8").Value
Yo = Sheets("Tanks").Range("C11").Value
heur = Sheets("Tanks").Ranhe("F8").Value
hora = Sheets("Tanks").Range("F10").Value
densite = Sheets("Tanks").Range("H8").Value
Init0 = Sheets("Tanks").Range("A13").Value
Fin0 = Sheets("Tanks").Range("A14").Value
debit = Sheets("Tanks").Range("J8").Value
Select Case Caire
Case "TK1"
If Xo < 1060 Or Xo = 1060 Then
Init0 = (1808.7 * Xo) - 32200
ElseIf Xo > 1060 And (Xo < 1870 Or Xo = 1870) Then
Init0 = (1808.7 * Xo) - 31800
ElseIf Xo > 1870 And (Xo < 1930 Or Xo = 1930) Then
Init0 = (12.033 * Xo) - 3328113.5
ElseIf Xo > 1930 And (Xo < 2720 Or Xo = 2720) Then
Init0 = (1808.8 * Xo) - 143288
ElseIf Xo > 2720 And (Xo < 4700 Or Xo = 4700) Then
Init0 = (1809.7 * Xo) - 145740
ElseIf Xo > 4710 And (Xo < 6610 Or Xo = 6610) Then
Init0 = (1810.8 * Xo) - 150906
ElseIf Xo > 6610 And (Xo < 7370 Or Xo = 7370) Then
Init0 = (1811.1 * Xo) - 152823
ElseIf Xo > 7370 And (Xo < 7880 Or Xo = 7880) Then
Init0 = (1810.7 * Xo) - 149706
ElseIf Xo > 7880 And (Xo < 8740 Or Xo = 8740) Then
Init0 = (1810.1 * Xo) - 144842
ElseIf Xo > 8740 And (Xo < 10020 Or Xo = 10020) Then
Init0 = (1812 * Xo) - 161521
ElseIf Xo > 10020 And (Xo < 11810 Or Xo = 11810) Then
Init0 = (1812.7 * Xo) - 168329
ElseIf Xo > 11810 And (Xo < 13020 Or Xo = 13020) Then
Init0 = (1813.7 * Xo) - 180182
ElseIf Xo > 13020 And (Xo < 14220 Or Xo = 14220) Then
Init0 = (1813.8 * Xo) - 181618
ElseIf Xo > 14220 And (Xo < 15770 Or Xo = 15770) Then
Init0 = (1813.3 * Xo) - 174442
ElseIf Xo > 15770 And (Xo < 16460 Or Xo = 16460) Then
Init0 = (1814 * Xo) - 185546
Else
Init0 = (1814.7 * Xo) - 197059
End If
If Yo < 1060 Or Yo = 1060 Then
Fin0 = (1808.7 * Yo) - 32200
ElseIf Yo > 1060 And (Yo < 1870 Or Yo = 1870) Then
Fin0 = (1808.7 * Yo) - 31800
ElseIf Yo > 1870 And (Yo < 1930 Or Yo = 1930) Then
Fin0 = (12.033 * Yo) - 3328113.5
ElseIf Yo > 1930 And (Yo < 2720 Or Yo = 2720) Then
Fin0 = (1808.8 * Yo) - 143288
ElseIf Yo > 2720 And (Yo < 4700 Or Yo = 4700) Then
Fin0 = (1809.7 * Yo) - 145740
ElseIf Yo > 4710 And (Yo < 6610 Or Yo = 6610) Then
Fin0 = (1810.8 * Yo) - 150906
ElseIf Yo > 6610 And (Yo < 7370 Or Yo = 7370) Then
Fin0 = (1811.1 * Yo) - 152823
ElseIf Yo > 7370 And (Yo < 7880 Or Yo = 7880) Then
Fin0 = (1810.7 * Yo) - 149706
ElseIf Yo > 7880 And (Yo < 8740 Or Yo = 8740) Then
Fin0 = (1810.1 * Yo) - 144842
ElseIf Yo > 8740 And (Yo < 10020 Or Yo = 10020) Then
Fin0 = (1812 * Yo) - 161521
ElseIf Yo > 10020 And (Yo < 11810 Or Yo = 11810) Then
Fin0 = (1812.7 * Yo) - 168329
ElseIf Yo > 11810 And (Yo < 13020 Or Yo = 13020) Then
Fin0 = (1813.7 * Yo) - 180182
ElseIf Yo > 13020 And (Yo < 14220 Or Yo = 14220) Then
Fin0 = (1813.8 * Yo) - 181618
ElseIf Yo > 14220 And (Yo < 15770 Or Yo = 15770) Then
Fin0 = (1813.3 * Yo) - 174442
ElseIf Yo > 15770 And (Yo < 16460 Or Yo = 16460) Then
Fin0 = (1814 * Yo) - 185546
Else
Fin0 = (1814.7 * Yo) - 197059
End If
Case "TK2"
If Xo < 1220 Or Xo = 1220 Then
Init0 = (746.58 * Xo) - 39374
ElseIf Xo > 1220 And (Xo < 4290 Or Xo = 4290) Then
Init0 = (747.07 * Xo) - 40000
ElseIf Xo > 4290 And (Xo < 6570 Or Xo = 6570) Then
Init0 = (747.48 * Xo) - 41753
ElseIf Xo > 6570 And (Xo < 11310 Or Xo = 11310) Then
Init0 = (748.18 * Xo) - 46344
ElseIf Xo > 11310 And (Xo < 13690 Or Xo = 13690) Then
Init0 = (748.82 * Xo) - 53444
ElseIf Xo > 13690 And (Xo < 14760 Or Xo = 14760) Then
Init0 = (749.45 * Xo) - 61947
Else
Init0 = (782.92 * Xo) - 54221
End If
If Yo < 1220 Or Yo = 1220 Then
Fin0 = (746.58 * Yo) - 39374
ElseIf Yo > 1220 And (Yo < 4290 Or Yo = 4290) Then
Fin0 = (747.07 * Yo) - 40000
ElseIf Yo > 4290 And (Yo < 6570 Or Yo = 6570) Then
Fin0 = (747.48 * Yo) - 41753
ElseIf Yo > 6570 And (Yo < 11310 Or Yo = 11310) Then
Fin0 = (748.18 * Yo) - 46344
ElseIf Yo > 11310 And (Yo < 13690 Or Yo = 13690) Then
Fin0 = (748.82 * Yo) - 53444
ElseIf Yo > 13690 And (Yo < 14760 Or Yo = 14760) Then
Fin0 = (749.45 * Yo) - 61947
Else
Fin0 = (782.92 * Yo) - 54221
End If
Case "TK3"
If Xo < 730 Or Xo = 730 Then
Init0 = (2845 * Xo) + 89382
ElseIf Xo > 730 And (Xo < 1520 Or Xo = 1520) Then
Init0 = (2844.2 * Xo) + 89706
ElseIf Xo > 1520 And (Xo < 2370 Or Xo = 2370) Then
Init0 = (2845.2 * Xo) + 88230
ElseIf Xo > 2370 And (Xo < 3730 Or Xo = 3730) Then
Init0 = (2844.7 * Xo) + 89662
ElseIf Xo > 3730 And (Xo < 4460 Or Xo = 4460) Then
Init0 = (2844.1 * Xo) + 91702
ElseIf Xo > 4470 And (Xo < 4880 Or Xo = 4880) Then
Init0 = (2843 * Xo) + 96457
ElseIf Xo > 4880 And (Xo < 6930 Or Xo = 6930) Then
Init0 = (2845.6 * Xo) + 83789
ElseIf Xo > 6930 And (Xo < 8960 Or Xo = 8960) Then
Init0 = (2846.9 * Xo) + 74933
ElseIf Xo > 8960 And (Xo < 10920 Or Xo = 10920) Then
Init0 = (2848.9 * Xo) + 57204
ElseIf Xo > 10920 And (Xo < 11310 Or Xo = 11310) Then
Init0 = (2848.9 * Xo) + 56994
ElseIf Xo > 11310 And (Xo < 11880 Or Xo = 11880) Then
Init0 = (2850.6 * Xo) + 37855
ElseIf Xo > 11880 And Xo < 12470 Or Xo = 12470 Then
Init0 = (2851.2 * Xo) + 30877
ElseIf Xo > 12470 And (Xo < 13130 Or Xo = 13130) Then
Init0 = (2851 * Xo) + 33108
Else
Init0 = (2852.6 * Xo) + 12090
End If
If Yo < 730 Or Yo = 730 Then
Fin0 = (2845 * Yo) + 89382
ElseIf Yo > 730 And (Yo < 1520 Or Yo = 1520) Then
Fin0 = (2844.2 * Yo) + 89706
ElseIf Yo > 1520 And (Yo < 2370 Or Yo = 2370) Then
Fin0 = (2845.2 * Yo) + 88230
ElseIf Yo > 2370 And (Yo < 3730 Or Yo = 3730) Then
Fin0 = (2844.7 * Yo) + 89662
ElseIf Yo > 3730 And (Yo < 4460 Or Yo = 4460) Then
Fin0 = (2844.1 * Yo) + 91702
ElseIf Yo > 4470 And (Yo < 4880 Or Yo = 4880) Then
Fin0 = (2843 * Yo) + 96457
ElseIf Yo > 4880 And (Yo < 6930 Or Yo = 6930) Then
Fin0 = (2845.6 * Yo) + 83789
ElseIf Yo > 6930 And (Yo < 8960 Or Yo = 8960) Then
Fin0 = (2846.9 * Yo) + 74933
ElseIf Yo > 8960 And (Yo < 10920 Or Yo = 10920) Then
Fin0 = (2848.9 * Yo) + 57204
ElseIf Yo > 10920 And (Yo < 11310 Or Yo = 11310) Then
Fin0 = (2848.9 * Yo) + 56994
ElseIf Yo > 11310 And (Yo < 11880 Or Yo = 11880) Then
Fin0 = (2850.6 * Yo) + 37855
ElseIf Yo > 11880 And (Yo < 12470 Or Yo = 12470) Then
Fin0 = (2851.2 * Yo) + 30877
ElseIf Yo > 12470 And (Yo < 13130 Or Yo = 13130) Then
Fin0 = (2851 * Yo) + 33108
Else
Fin0 = (2852.6 * Yo) + 12090
End If
Case "TK4"
If Xo < 1010 Or Xo = 1010 Then
Init0 = (2816.3 * Xo) - 7266.1
ElseIf Xo > 1010 And (Xo < 2020 Or Xo = 2020) Then
Init0 = (2817.6 * Xo) - 8575.5
ElseIf Xo > 2020 And (Xo < 2610 Or Xo = 2610) Then
Init0 = (2818.4 * Xo) - 10430
ElseIf Xo > 2610 And (Xo < 3540 Or Xo = 3540) Then
Init0 = (2819.8 * Xo) - 14099
ElseIf Xo > 3540 And (Xo < 4560 Or Xo = 4560) Then
Init0 = (2819.2 * Xo) - 12052
ElseIf Xo > 4560 And (Xo < 6390 Or Xo = 6390) Then
Init0 = (2820.8 * Xo) - 19198
ElseIf Xo > 6390 And (Xo < 6950 Or Xo = 6950) Then
Init0 = (2820.7 * Xo) - 18744
ElseIf Xo > 6950 And (Xo < 7770 Or Xo = 7770) Then
Init0 = (2822.7 * Xo) - 32574
ElseIf Xo > 7770 And (Xo < 9140 Or Xo = 9140) Then
Init0 = (2821.9 * Xo) - 26625
ElseIf Xo > 9140 And (Xo < 10440 Or Xo = 10440) Then
Init0 = (2824 * Xo) - 45843
ElseIf Xo > 10440 And (Xo < 11410 Or Xo = 11410) Then
Init0 = (2824.3 * Xo) - 48959
ElseIf Xo > 11410 And (Xo < 12610 Or Xo = 12610) Then
Init0 = (2827.4 * Xo) - 84323
ElseIf Xo > 12610 And (Xo < 13710 Or Xo = 13710) Then
Init0 = (2826.9 * Xo) - 78197
ElseIf Xo > 13710 And (Xo < 14190 Or Xo = 14190) Then
Init0 = (2830.9 * Xo) - 133032
ElseIf Xo > 14190 And (Xo < 14720 Or Xo = 14720) Then
Init0 = (2832.2 * Xo) - 152900
ElseIf Xo > 14720 And (Xo < 15210 Or Xo = 15210) Then
Init0 = (2833.8 * Xo) - 174976
Else
Init0 = (2832.4 * Xo) - 153689
End If
If Yo < 1010 Or Yo = 1010 Then
Fin0 = (2816.3 * Yo) - 7266.1
ElseIf Yo > 1010 And (Yo < 2020 Or Yo = 2020) Then
Fin0 = (2817.6 * Yo) - 8575.5
ElseIf Yo > 2020 And (Yo < 2610 Or Yo = 2610) Then
Fin0 = (2818.4 * Yo) - 10430
ElseIf Yo > 2610 And (Yo < 3540 Or Yo = 3540) Then
Fin0 = (2819.8 * Yo) - 14099
ElseIf Yo > 3540 And (Yo < 4560 Or Yo = 4560) Then
Fin0 = (2819.2 * Yo) - 12052
ElseIf Yo > 4560 And (Yo < 6390 Or Yo = 6390) Then
Fin0 = (2820.8 * Yo) - 19198
ElseIf Yo > 6390 And (Yo < 6950 Or Yo = 6950) Then
Fin0 = (2820.7 * Yo) - 18744
ElseIf Yo > 6950 And (Yo < 7770 Or Yo = 7770) Then
Fin0 = (2822.7 * Yo) - 32574
ElseIf Yo > 7770 And (Yo < 9140 Or Yo = 9140) Then
Fin0 = (2821.9 * Yo) - 26625
ElseIf Yo > 9140 And (Yo < 10440 Or Yo = 10440) Then
Fin0 = (2824 * Yo) - 45843
ElseIf Yo > 10440 And (Yo < 11410 Or Yo = 11410) Then
Fin0 = (2824.3 * Yo) - 48959
ElseIf Yo > 11410 And (Yo < 12610 Or Yo = 12610) Then
Fin0 = (2827.4 * Yo) - 84323
ElseIf Yo > 12610 And (Yo < 13710 Or Yo = 13710) Then
Fin0 = (2826.9 * Yo) - 78197
ElseIf Yo > 13710 And (Yo < 14190 Or Yo = 14190) Then
Fin0 = (2830.9 * Yo) - 133032
ElseIf Yo > 14190 And (Yo < 14720 Or Yo = 14720) Then
Fin0 = (2832.2 * Yo) - 152900
ElseIf Yo > 14720 And (Yo < 15210 Or Yo = 15210) Then
Fin0 = (2833.8 * Yo) - 174976
Else
Fin0 = (2832.4 * Yo) - 153689
End If
Case "TK900"
If Xo < 1170 Or Xo = 1170 Then
Init0 = (112.94 * Xo) + 2338.2
ElseIf Xo > 1170 And (Xo < 3520 Or Xo = 3520) Then
Init0 = (112.95 * Xo) + 2417.6
ElseIf Xo > 3520 And (Xo < 7290 Or Xo = 7290) Then
Init0 = (113.08 * Xo) + 2000
Else
Init0 = (113.18 * Xo) + 1376.7
End If
If Yo < 1170 Or Yo = 1170 Then
Fin0 = (112.94 * Yo) + 2338.2
ElseIf Yo > 1170 And (Yo < 3520 Or Yo = 3520) Then
Fin0 = (112.95 * Yo) + 2417.6
ElseIf Yo > 3520 And (Yo < 7290 Or Yo = 7290) Then
Fin0 = (113.08 * Yo) + 2000
Else
Fin0 = (113.18 * Yo) + 1376.7
End If
Case "TK901"
Init0 = (15.9 * Xo)
Fin0 = 15.9 * Yo
Case "TK902"
Init0 = 50.3 * Xo
Fin0 = 50.3 * Yo
Case "TK1001"
Init0 = 1385 * Xo
Fin0 = 1385 * Yo
Case "TK1011"
Init0 = 314 * Xo
Fin0 = 314 * Yo
Case "TK1012"
Init0 = 201 * Xo
Fin0 = 201 * Yo
Case "TK1013"
If Xo < 1740 Or Xo = 1740 Then
Init0 = (113.02 * Xo) + 6684.2
ElseIf Xo > 1740 And (Xo < 1790 Or Xo = 1790) Then
Init0 = (0.97 * Xo) + 205035.3
ElseIf Xo > 1790 And (Xo < 3950 Or Xo = 3950) Then
Init0 = (113.08 * Xo) + 316.5
ElseIf Xo > 3950 And (Xo < 6040 Or Xo = 6040) Then
Init0 = (113.21 * Xo) + 190
Else
Init0 = (113.4 * Xo) + 1327.9
End If
If Yo < 1740 Or Yo = 1740 Then
Fin0 = (113.02 * Yo) + 6684.2
ElseIf Yo > 1740 And (Yo < 1790 Or Yo = 1790) Then
Fin0 = (0.97 * Yo) + 205035.3
ElseIf Yo > 1790 And (Yo < 3950 Or Yo = 3950) Then
Fin0 = (113.08 * Yo) + 316.5
ElseIf Yo > 3950 And (Yo < 6040 Or Yo = 6040) Then
Fin0 = (113.21 * Yo) + 190
Else
Fin0 = (113.4 * Yo) + 1327.9
End If
Case "TK1015"
Init0 = 314 * Xo
Fin0 = 314 * Yo
Case "TK1021"
If Xo < 2100 Or Xo = 2100 Then
Init0 = (201.29 * Xo) + 23913
ElseIf Xo > 2100 And (Xo < 9800 Or Xo = 9800) Then
Init0 = (201.42 * Xo) + 23523
Else
Init0 = (201.52 * Xo) + 23065
End If
If Yo < 2100 Or Yo = 2100 Then
Fin0 = (201.29 * Yo) + 23913
ElseIf Yo > 2100 And (Yo < 9800 Or Yo = 9800) Then
Fin0 = (201.42 * Yo) + 23523
Else
Fin0 = (201.52 * Yo) + 23065
End If
Case "TK1022"
If Xo < 6830 Or Xo = 6830 Then
Init0 = (113.56 * Xo) + 12270
Else
Init0 = (113.74 * Xo) + 11034
End If
If Yo < 6830 Or Yo = 6830 Then
Fin0 = (113.56 * Yo) + 12270
Else
Fin0 = (113.74 * Yo) + 11034
End If
If Xo < 840 Or Xo = 840 Then
Init0 = (451.15 * Xo) + 61994
ElseIf Xo > 840 And (Xo < 1280 Or Xo = 1280) Then
Init0 = (451.2 * Xo) + 62083
ElseIf Xo > 1280 And (Xo < 2430 Or Xo = 2430) Then
Init0 = (451.74 * Xo) + 61384
ElseIf Xo > 2430 And (Xo < 8590 Or Xo = 8590) Then
Init0 = (451.73 * Xo) + 61290
ElseIf Xo > 8590 And (Xo < 11460 Or Xo = 11460) Then
Init0 = (451.7 * Xo) + 61949
Else
Init0 = (541.49 * Xo) + 64559
End If
If Yo < 840 Or Yo = 840 Then
Fin0 = (451.15 * Yo) + 61994
ElseIf Yo > 840 And (Yo < 1280 Or Yo = 1280) Then
Fin0 = (451.2 * Yo) + 62083
ElseIf Yo > 1280 And (Yo < 2430 Or Yo = 2430) Then
Fin0 = (451.74 * Yo) + 61384
ElseIf Yo > 2430 And (Yo < 8590 Or Yo = 8590) Then
Fin0 = (451.73 * Yo) + 61290
ElseIf Yo > 8590 And (Yo < 11460 Or Yo = 11460) Then
Fin0 = (451.7 * Yo) + 61949
Else
Fin0 = (541.49 * Yo) + 64559
End If
Case Caire = "TK1032"
If Xo < 2720 Or Xo = 2720 Then
Init0 = (199.25 * Xo) + 22400
ElseIf (Xo < 6240 Or Xo = 6240) And Xo > 2720 Then
Init0 = (199.58 * Xo) + 21598
ElseIf (Xo < 7790 Or Xo = 7790) And Xo > 6240 Then
Init0 = (199.58 * Xo) + 21725
ElseIf (Xo < 9740 Or Xo = 9740) And Xo > 7790 Then
Init0 = (199.58 * Xo) + 21835
Else
Init0 = (199.66 * Xo) + 21311
End If
If Yo < 2720 Or Yo = 2720 Then
Fin0 = (199.25 * Yo) + 22400
ElseIf (Yo < 6240 Or Yo = 6240) And Yo > 2720 Then
Fin0 = (199.58 * Yo) + 21598
ElseIf (Yo < 7790 Or Yo = 7790) And Xo > 6240 Then
Fin0 = (199.58 * Yo) + 21725
ElseIf (Yo < 9740 Or Yo = 9740) And Yo > 7790 Then
Fin0 = (199.58 * Yo) + 21835
Else
Fin0 = (199.66 * Yo) + 21311
End If
Case "TK1033"
If Xo < 2690 Or Xo = 2690 Then
Init0 = (450.89 * Xo) + 9902.7
ElseIf Xo > 2690 And (Xo < 5020 Or Xo = 5020) Then
Init0 = (451.05 * Xo) + 9574.7
ElseIf Xo > 5020 And (Xo < 7610 Or Xo = 7610) Then
Init0 = (450.7 * Xo) + 11300
ElseIf Xo > 7610 And (Xo < 9530 Or Xo = 9530) Then
Init0 = (451.15 * Xo) + 7914.8
ElseIf Xo > 9530 And (Xo < 10630 Or Xo = 10630) Then
Init0 = (451.38 * Xo) + 5563.5
ElseIf Xo > 10630 And (Xo < 11460 Or Xo = 11460) Then
Init0 = (451.37 * Xo) + 5827.7
ElseIf Xo > 11470 And (Xo < 12150 Or Xo = 12150) Then
Init0 = (451.07 * Xo) + 9117.1
Else
Init0 = (541.4 * Xo) + 5203.5
End If
If Yo < 2690 Or Yo = 2690 Then
Fin0 = (450.89 * Yo) + 9902.7
ElseIf Yo > 2690 And (Yo < 5020 Or Yo = 5020) Then
Fin0 = (451.05 * Yo) + 9574.7
ElseIf Yo > 5020 And (Yo < 7610 Or Yo = 7610) Then
Fin0 = (450.7 * Yo) + 11300
ElseIf Yo > 7610 And (Yo < 9530 Or Yo = 9530) Then
Fin0 = (451.15 * Yo) + 7914.8
ElseIf Yo > 9530 And (Yo < 10630 Or Yo = 10630) Then
Fin0 = (451.38 * Yo) + 5563.5
ElseIf Yo > 10630 And (Yo < 11460 Or Yo = 11460) Then
Fin0 = (451.37 * Yo) + 5827.7
ElseIf Yo > 11470 And (Yo < 12150 Or Yo = 12150) Then
Fin0 = (451.07 * Yo) + 9117.1
Else
Fin0 = (541.4 * Yo) + 5203.5
End If
Case "TK1041"
If Xo < 1290 Or Xo = 1290 Then
Init0 = (704.61 * Xo) + 82643
ElseIf Xo > 1290 And (Xo < 2660 Or Xo = 2660) Then
Init0 = (704.78 * Xo) + 82500
ElseIf Xo > 2660 And (Xo < 3530 Or Xo = 3530) Then
Init0 = (704.41 * Xo) + 83392
ElseIf Xo > 3530 And (Xo < 4800 Or Xo = 4800) Then
Init0 = (704.57 * Xo) + 82929
ElseIf Xo > 4800 And (Xo < 5600 Or Xo = 5600) Then
Init0 = (704.77 * Xo) + 81992
ElseIf Xo > 5600 And (Xo < 6820 Or Xo = 6820) Then
Init0 = (704.97 * Xo) + 80860
ElseIf Xo > 6820 And (Xo < 8390 Or Xo = 8390) Then
Init0 = (705.54 * Xo) + 76951
ElseIf Xo > 8390 And (Xo < 10340 Or Xo = 10340) Then
Init0 = (705.18 * Xo) + 79818
ElseIf Xo > 10340 And (Xo < 12390 Or Xo = 12390) Then
Init0 = (705.58 * Xo) + 75688
Else
Init0 = (705.54 * Xo) + 76367
End If
If Yo < 1290 Or Yo = 1290 Then
Fin0 = (704.61 * Yo) + 82643
ElseIf Yo > 1290 And (Yo < 2660 Or Yo = 2660) Then
Fin0 = (704.78 * Yo) + 82500
ElseIf Yo > 2660 And (Yo < 3530 Or Yo = 3530) Then
Fin0 = (704.41 * Yo) + 83392
ElseIf Yo > 3530 And (Yo < 4800 Or Yo = 4800) Then
Fin0 = (704.57 * Yo) + 82929
ElseIf Yo > 4800 And (Yo < 5600 Or Yo = 5600) Then
Fin0 = (704.77 * Yo) + 81992
ElseIf Yo > 5600 And (Yo < 6820 Or Yo = 6820) Then
Fin0 = (704.97 * Yo) + 80860
ElseIf Yo > 6820 And (Yo < 8390 Or Yo = 8390) Then
Fin0 = (705.54 * Yo) + 76951
ElseIf Yo > 8390 And (Yo < 10340 Or Yo = 10340) Then
Fin0 = (705.18 * Yo) + 79818
ElseIf Yo > 10340 And (Yo < 12390 Or Yo = 12390) Then
Fin0 = (705.58 * Yo) + 75688
Else
Fin0 = (705.54 * Yo) + 76367
End If
Case "TK1042"
If Xo < 920 Or Xo = 920 Then
Init0 = (706.4 * Xo) + 100482
ElseIf Xo > 920 And (Xo < 4950 Or Xo = 4950) Then
Init0 = (706.8 * Xo) + 94400
ElseIf Xo > 4950 And (Xo < 6680 Or Xo = 6680) Then
Init0 = (706.6 * Xo) + 95220
ElseIf Xo > 6680 And (Xo < 8950 Or Xo = 8950) Then
Init0 = (706.86 * Xo) + 93377
ElseIf Xo > 8960 And (Xo < 12610 Or Xo = 12610) Then
Init0 = (706.8 * Xo) + 94011
Else
Init0 = (707.26 * Xo) - 88185.9
End If
If Yo < 920 Or Yo = 920 Then
Fin0 = (706.4 * Yo) + 100482
ElseIf Yo > 920 And (Yo < 4950 Or Yo = 4950) Then
Fin0 = (706.8 * Yo) + 94400
ElseIf Yo > 4950 And (Yo < 6680 Or Yo = 6680) Then
Fin0 = (706.6 * Yo) + 95220
ElseIf Yo > 6680 And (Yo < 8950 Or Yo = 8950) Then
Fin0 = (706.86 * Yo) + 93377
ElseIf Yo > 8960 And (Yo < 12610 Or Yo = 12610) Then
Fin0 = (706.8 * Yo) + 94011
Else
Fin0 = (707.26 * Yo) - 88185.9
End If
Case "TK1043"
If Xo < 740 Or Xo = 740 Then
Init0 = (1364.8 * Xo) + 24840
ElseIf Xo > 740 And (Xo < 1660 Or Xo = 1660) Then
Init0 = (1365.5 * Xo) + 24396
ElseIf Xo > 1660 And (Xo < 1880 Or Xo = 1880) Then
Init0 = (1365.8 * Xo) + 23942
ElseIf Xo > 1880 And (Xo < 2890 Or Xo = 2890) Then
Init0 = (1366.4 * Xo) + 22830
ElseIf Xo > 2890 And (Xo < 3620 Or Xo = 3620) Then
Init0 = (1366 * Xo) + 23893
ElseIf Xo > 3620 And (Xo < 4740 Or Xo = 4740) Then
Init0 = (1367.5 * Xo) + 18470
ElseIf Xo < 4740 And (Xo < 5070 Or Xo = 5070) Then
Init0 = (1367.8 * Xo) + 16900
ElseIf Xo > 5070 And (Xo < 6270 Or Xo = 6270) Then
Init0 = (1368 * Xo) + 15739
ElseIf Xo > 6270 And (Xo < 7280 Or Xo = 7280) Then
Init0 = (1367.4 * Xo) + 19515
ElseIf Xo > 7280 And (Xo < 9070 Or Xo = 9070) Then
Init0 = (1368.7 * Xo) + 10064
ElseIf Xo > 9070 And (Xo < 10870 Or Xo = 10870) Then
Init0 = (1369.5 * Xo) + 2885.7
ElseIf Xo > 10870 And (Xo < 12360 Or Xo = 12360) Then
Init0 = (1371.8 * Xo) - 22122
ElseIf Xo > 12360 And (Xo < 12960 Or Xo = 12960) Then
Init0 = (1372.3 * Xo) - 28438
Else
Init0 = (1372.5 * Xo) - 30876
End If
If Yo < 740 Or Yo = 740 Then
Fin0 = (1364.8 * Yo) + 24840
ElseIf Yo > 740 And (Yo < 1660 Or Yo = 1660) Then
Fin0 = (1365.5 * Yo) + 24396
ElseIf Yo > 1660 And (Yo < 1880 Or Yo = 1880) Then
Fin0 = (1365.8 * Yo) + 23942
ElseIf Yo > 1880 And (Yo < 2890 Or Yo = 2890) Then
Fin0 = (1366.4 * Yo) + 22830
ElseIf Yo > 2890 And (Yo < 3620 Or Yo = 3620) Then
Fin0 = (1366 * Yo) + 23893
ElseIf Yo > 3620 And (Yo < 4740 Or Yo = 4740) Then
Fin0 = (1367.5 * Yo) + 18470
ElseIf Yo > 4740 And (Yo < 5070 Or Yo = 5070) Then
Fin0 = (1367.8 * Yo) + 16900
ElseIf Yo > 5070 And (Yo < 6270 Or Yo = 6270) Then
Fin0 = (1368 * Yo) + 15739
ElseIf Yo > 6270 And (Yo < 7280 Or Yo = 7280) Then
Fin0 = (1367.4 * Yo) + 19515
ElseIf Yo > 7280 And (Yo < 9070 Or Yo = 9070) Then
Fin0 = (1368.7 * Yo) + 10064
ElseIf Yo > 9070 And (Yo < 10870 Or Yo = 10870) Then
Fin0 = (1369.5 * Yo) + 2885.7
ElseIf Yo > 10870 And (Yo < 12360 Or Yo = 12360) Then
Fin0 = (1371.8 * Yo) - 22122
ElseIf Yo > 12360 And (Yo < 12960 Or Yo = 12960) Then
Fin0 = (1372.3 * Yo) - 28438
Else
Fin0 = (1372.5 * Yo) - 30876
End If
Case "TK1051"
If Xo < 750 Or Xo = 750 Then
Init0 = (200.7 * Xo) + 53944
Else
Init0 = (200.84 * Xo) + 54090
End If
If Yo < 750 Or Yo = 750 Then
Fin0 = (200.7 * Yo) + 53944
Else
Fin0 = (200.84 * Yo) + 54090
End If
Case "TK1052"
If Xo < 600 Or Xo = 600 Then
Init0 = (50.369 * Xo) + 1718.4
Else
Init0 = (50.251 * Xo) + 1439.9
End If
If Yo < 600 Or Yo = 600 Then
Fin0 = (50.369 * Yo) + 1718.4
Else
Fin0 = (50.251 * Yo) + 1439.9
End If
Case "TK1053"
Init0 = 50 * Xo
Fin0 = 50 * Yo
Case "TK1054"
Init0 = 28 * Xo
Fin0 = 28 * Yo
Case "Tk1055"
Init0 = 78 * Xo
Fin0 = 78 * Yo
Case Else
If Xo < 3020 Or Xo = 3020 Then
Init0 = (114.4 * Xo) + 9799.2
ElseIf (Xo < 4780 Or Xo = 4780) And Xo > 3020 Then
Init0 = (114.33 * Xo) + 9944.1
ElseIf (Xo < 7010 Or Xo = 7010) And Xo > 4780 Then
Init0 = (114.33 * Xo) + 10064
Else
Init0 = (114.1 * Xo) + 11661
End If
If Yo < 3020 Or Yo = 3020 Then
Fin0 = (114.4 * Yo) + 9799.2
ElseIf (Yo < 4780 Or Yo = 4780) And Yo > 3020 Then
Fin0 = (114.33 * Yo) + 9944.1
ElseIf (Yo < 7010 Or Yo = 7010) And Yo > 4780 Then
Fin0 = (114.33 * Yo) + 10064
Else
Fin0 = (114.1 * Yo) + 11661
End If