Option
Explicit
Public
aVorgegebenerBereich
As
Range
Public
aTitelZelle
As
String
Public
aTextBoxBereich
As
String
Public
aIndex%
Dim
ZielBlatt
As
Worksheet
Dim
DT
As
New
Datentransfer
Sub
Initialize()
If
aVorgegebenerBereich
Is
Nothing
Or
aTextBoxBereich =
""
Then
NewInput
Exit
Sub
End
If
aVorgegebenerBereich.Parent.Activate
With
DT
Set
.UF =
Me
.ZellenEinlesen aVorgegebenerBereich
.ControlType =
"TextBox"
.ControlsEinlesen aTextBoxBereich
.Import
End
With
End
Sub
Private
Sub
UserForm_Activate()
With
TextBox2
.SetFocus
.SelStart = 0
.SelLength = Len(.Text)
End
With
Me
.TextBox1.Value = aTitelZelle
End
Sub
Private
Sub
cmdSave_Click()
With
DT
.ControlsEinlesen aTextBoxBereich
If
.Überprüfen
Then
.ControlsEinlesen aTextBoxBereich
.Export
End
If
End
With
End
Sub
Private
Sub
cmdNewInput_Click()
NewInput
End
Sub
Private
Sub
cmdAbort_Click()
Unload
Me
End
Sub
Private
Sub
cmdReset_Click()
DT.Bereich = 0
Unload
Me
UF_Tabelle.Show
End
Sub
Private
Sub
TextBox2_KeyPress(
ByVal
KeyAscii
As
MSForms.ReturnInteger)
Check ActiveControl, KeyAscii
End
Sub
Private
Sub
TextBox3_KeyPress(
ByVal
KeyAscii
As
MSForms.ReturnInteger)
Check ActiveControl, KeyAscii
End
Sub
Private
Sub
TextBox4_KeyPress(
ByVal
KeyAscii
As
MSForms.ReturnInteger)
Check ActiveControl, KeyAscii
End
Sub
Private
Sub
TextBox5_KeyPress(
ByVal
KeyAscii
As
MSForms.ReturnInteger)
Check ActiveControl, KeyAscii
End
Sub
Private
Sub
TextBox6_KeyPress(
ByVal
KeyAscii
As
MSForms.ReturnInteger)
Check ActiveControl, KeyAscii
End
Sub
Private
Sub
TextBox7_KeyPress(
ByVal
KeyAscii
As
MSForms.ReturnInteger)
Check ActiveControl, KeyAscii
End
Sub
Private
Sub
TextBox8_KeyPress(
ByVal
KeyAscii
As
MSForms.ReturnInteger)
Check ActiveControl, KeyAscii
End
Sub
Private
Sub
TextBox9_KeyPress(
ByVal
KeyAscii
As
MSForms.ReturnInteger)
Check ActiveControl, KeyAscii
End
Sub
Private
Sub
TextBox10_KeyPress(
ByVal
KeyAscii
As
MSForms.ReturnInteger)
Check ActiveControl, KeyAscii
End
Sub
Private
Sub
TextBox11_KeyPress(
ByVal
KeyAscii
As
MSForms.ReturnInteger)
Check ActiveControl, KeyAscii
End
Sub
Private
Sub
TextBox12_KeyPress(
ByVal
KeyAscii
As
MSForms.ReturnInteger)
Check ActiveControl, KeyAscii
End
Sub
Private
Sub
TextBox13_KeyPress(
ByVal
KeyAscii
As
MSForms.ReturnInteger)
Check ActiveControl, KeyAscii
End
Sub
Private
Sub
NewInput()
Set
aVorgegebenerBereich =
Nothing
aTitelZelle =
""
aTextBoxBereich =
""
DT.SteuerelementeResetten
ShowForm aIndex + 1
End
Sub
Private
Sub
Check(ctr
As
Control, Key
As
MSForms.ReturnInteger)
Dim
str
As
String
If
TypeOf
ActiveControl
Is
Frame
Then
str = Controls(
Me
.ActiveControl.Name).ActiveControl.Text
Else
str = ActiveControl.Text
End
If
If
Not
IsNumeric(str & Chr(Key))
Then
Key = 0
Beep
End
If
End
Sub
Private
Sub
UserForm_MouseMove(
ByVal
Button
As
Integer
,
ByVal
Shift
As
Integer
,
ByVal
X
As
Single
,
ByVal
Y
As
Single
)
Dim
ctr
As
Control
For
Each
ctr
In
Me
.Controls
Dim
cX%, cY%
With
ctr
If
X >= .Left - 1
And
X <= .Left + .Width + 1
Then
If
Y >= .Top - 1
And
Y <= .Top + .Height + 1
Then
If
InStr(ctr.Name,
"cmd"
) > 0
Then
ctr.SetFocus
End
If
End
If
End
If
End
With
Next
End
Sub