Gruppe
Funktion
Problem
In den Bereich A15:D22 sollen die Daten aus dem in Zelle B2 benannten Tabellenblatt, Bereich A1:D8, eingefügt werden.
ClassModule: frmInsert
Dim blnCtrl As Boolean
Private Sub txtInsert_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
With txtInsert
If KeyCode = 17 Then
blnCtrl = True
ElseIf KeyCode = 82 And blnCtrl Then
.Text = Left(.Text, .SelStart) & Chr(174) & Right(.Text, Len(.Text) - .SelStart)
blnCtrl = False
ElseIf KeyCode = 84 And blnCtrl Then
.Text = Left(.Text, .SelStart) & Chr(153) & Right(.Text, Len(.Text) - .SelStart)
blnCtrl = False
Else
blnCtrl = False
End If
End With
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub UserForm_Initialize()
txtInsert.SelStart = 4
End Sub
StandardModule: Modul1
Sub CallForm()
frmInsert.Show
End Sub