Private
Sub
CMD_Copy_Click()
Dim
sc
As
Range, st
As
Range
If
Me
.ListBoxB.ListIndex < 0
Or
Me
.ListBoxB.ListIndex < 0
Then
Exit
Sub
With
Sheets(
"Export"
)
Set
sc = .Range(
"AK1"
).CurrentRegion.Find(
Me
.ListBoxB.Value)
If
Not
sc
Is
Nothing
Then
Set
sc = Range(sc.Offset(0, -3), sc.Offset(36, 31))
Set
st = .UsedRange.Find(
Me
.ListBoxA.Value)
If
Not
st
Is
Nothing
Then
Set
st = Range(st.Offset(0, -3), st.Offset(36, 31))
If
Not
sc
Is
Nothing
And
Not
st
Is
Nothing
Then
Select
Case
MsgBox(
"von "
& sc.Address &
" - nach "
& st.Address, _
vbOKCancel
Or
vbInformation
Or
vbDefaultButton1,
"CMD_Copy"
)
Case
vbOK
sc.Copy
st.PasteSpecial Paste:=xlPasteValues
Case
vbCancel
End
Select
Else
Call
MsgBox(
"Fehler im Bereich!"
, vbCritical,
"Abbruch CMD_Copy"
)
End
If
End
With
End
Sub