Hier noch ein kleines Programm für die Bahncard
Option
Explicit
Sub
Bahncard()
Dim
Kilometer
As
Integer
Dim
Haeufigkeit
As
Byte
Dim
Klasse
As
Byte
Dim
GP_oBC
As
Long
Dim
GP_BC25
As
Long
Dim
GP_BC50
As
Long
Dim
GP_BC100
As
Long
Dim
Empfehlung
As
String
Kilometer = Worksheets(
"Bahncard"
).Cells(2, 4).Value
Haeufigkeit = Worksheets(
"Bahncard"
).Cells(4, 4).Value
Klasse = Worksheets(
"Bahncard"
).Cells(6, 4).Value
Select
Case
Klasse
Case
Is
= 1
GP_oBC = 0.6 * Kilometer * Haeufigkeit
GP_BC25 = 0.6 * Kilometer * Haeufigkeit * 0.75 + 119
GP_BC50 = 0.6 * Kilometer * Haeufigkeit * 0.5 + 482
GP_BC100 = 6690
Case
Is
= 2
GP_oBC = 0.3 * Kilometer * Haeufigkeit
GP_BC25 = 0.3 * Kilometer * Haeufigkeit * 0.75 + 59
GP_BC50 = 0.3 * Kilometer * Haeufigkeit * 0.5 + 240
GP_BC100 = 3990
End
Select
If
GP_BC100 < GP_BC50
Then
Empfehlung =
"BC 100"
Else
If
GP_BC50 < GP_BC25
Then
Empfehlung =
"BC 50"
Else
If
GP_BC25 < GP_oBC
Then
Empfehlung =
"BC 25"
Else
Empfehlung =
"oBC"
End
If
End
If
End
If
Worksheets(
"Bahncard"
).Cells(10, 4).Value = GP_oBC
Worksheets(
"Bahncard"
).Cells(11, 4).Value = GP_BC25
Worksheets(
"Bahncard"
).Cells(12, 4).Value = GP_BC50
Worksheets(
"Bahncard"
).Cells(13, 4).Value = GP_BC100
Worksheets(
"Bahncard"
).Cells(15, 4).Value = Empfehlung
End
Sub