Option
Explicit
Private
Sub
CommandButton1_Click()
Dim
rng
As
Range, Spalte
As
Range
Dim
i
As
Integer
, x
As
Integer
Dim
Ergebnis
As
String
On
Error
Resume
Next
Set
rng = Columns(1).Find( _
what:=ComboBox1.Text)
If
rng
Is
Nothing
Then
MsgBox
"Suchbegriff wurde nicht gefunden!"
End
If
Set
Spalte = Rows(11).Find( _
what:=ComboBox2.Text)
If
Spalte
Is
Nothing
Then
MsgBox
"Suchbegriff wurde nicht gefunden!"
End
If
i = rng.Row
x = Spalte.Column
Ergebnis = Format(Cells(i, x),
"#,##0"
)
MsgBox
"Quelltarif: "
& ComboBox1 & vbNewLine &
"Zieltarif: "
& ComboBox2 & vbNewLine _
& vbNewLine &
"Hinweis!:"
& vbNewLine & Ergebnis
End
Sub
Private
Sub
UserForm_Initialize()
Dim
c
For
Each
c
In
Range(
"A11:A87"
).Cells
ComboBox1.AddItem c
Next
ComboBox1.ListIndex = 1
For
Each
c
In
Range(
"b11:bx11"
).Cells
ComboBox2.AddItem c
Next
ComboBox2.ListIndex = 0
End
Sub
Private
Sub
CommandButton2_Click()
Unload
Me
End
Sub
Sub
auf()
UserForm1.Show
End
Sub