Ich habe ein kleines Problem. Ich bin noch Anfänger in VBA und versuche mich nach und nach weiter ranzutasten. Leider brächte ich für mein Problem möglichst bald eine Lösung, sodass ich hier meine Frage stelle.
Ich möchte in Tabellenblatt 2 Daten aus Tabellenblatt 1 kopieren. Dafür habe ich eine Befehlsschaltfläche kreiert bei dem der Benutzer den Bereich in Tabllenblatt 1 markieren kann und durch bestätigen die Daten kopiert werden. Der Code schaut so aus.
Option Explicit
Sub kopieren4()
Dim Bereich
Application.DisplayAlerts = False
On Error GoTo Abbruch
Set Bereich = Application.InputBox("- Please got to the tab ELINK(2)" & vbLf & "- mark the _
outputs for base load operation starting in cell 14", , , , , , , 8)
Bereich.Copy Destination:=Range("B5")
MsgBox Bereich.Address & " were copied"
Abbruch:
Application.DisplayAlerts = True
End Sub
Jetzt wäre es aber noch super das wenn man auf den Butto klickt in tabllenblatt 1 gelangt und wenn man bestätigt in Tabllenblatt 2 zurück kommt.
Option Explicit
Sub kopieren4()
Dim Bereich
Application.DisplayAlerts = False
On Error GoTo Abbruch
Worksheet("Tabelle1").select
Set Bereich = Application.InputBox("- Please got to the tab tabelle1" & vbLf & "- mark the _
outputs ", , , , , , , 8)
Bereich.Copy Destination:=Range("B5")
MsgBox Bereich.Address & " were copied"
Abbruch:
Application.DisplayAlerts = True
End Sub
Mit diesem Code springt er jetzt zwar in das Tabellenblatt 1 aber er kopiert die Daten nicht mehr. Muss ich die befehle mit einander verbinden?
Schon danke im Vorraus