Thema Datum  Von Nutzer Rating
Antwort
28.04.2017 01:19:42 Arni
NotSolved
28.04.2017 01:50:44 Gast42113
NotSolved
28.04.2017 01:52:23 Gast42113
NotSolved
28.04.2017 06:59:08 GraFri
NotSolved
29.04.2017 12:18:43 Arni
NotSolved
Blau Mehrsprachige MsgBox
29.04.2017 15:01:11 Arni
NotSolved
30.04.2017 08:33:12 GraFri
NotSolved
30.04.2017 18:39:59 Arni
NotSolved

Ansicht des Beitrags:
Von:
Arni
Datum:
29.04.2017 15:01:11
Views:
661
Rating: Antwort:
  Ja
Thema:
Mehrsprachige MsgBox

Ich habe noch eine Frage. 

Ich habe den Code leicht angepasst und für die anderen Messageboxen verwendet. In einem anderem Makro sind mehrere Messageboxen. Die erste Box ist eine VbYesNoCancel, die funktioniert einwandfrei, deshalb lasse ich den Teil untem im Code aus.  

Danach folgenden 6 vbRetryCancel Boxen, welche auftauchen ,wenn eine Überschrift , in einer anderen Datei aus der Daten importiert werden sollen, nicht gefunden wird. Es gibt also 6 Überschriften nach denen gesucht wird. Bei der ersten Überschrift ("Euribor 2Y") funktioniert das Makro einwandfrei, bei den sich anschließenden Überschriften funktioniert es nicht mehr, da taucht nur ne leere "Errorbox" auf und das Makro bricht (richtigerweise) ab, da die Daten in der Quelldatei wegen der fehlenden Überschrift nicht weiter sortiert werden können.

Der Codeausschnitt ist anbei und sieht wie folgt aus:

 

Dim Euribor2 As Range
    Dim Euribor1 As Range
    Dim ShareB As Range
    Dim ShareA As Range
    Dim Wechselkurs As Range
    Dim DateX As Range
    
    Dim msgText1() As String
    ReDim msgText1(1, 1 To 3, 1 To 2)
    Dim Antwort1
    
    Dim msgText2() As String
    ReDim msgText2(1, 1 To 3, 1 To 2)
    Dim Antwort2
    
    Dim msgText3() As String
    ReDim msgText3(1, 1 To 3, 1 To 2)
    Dim Antwort3
    
    Dim msgText4() As String
    ReDim msgText4(1, 1 To 3, 1 To 2)
    Dim Antwort4
    
    Dim msgText5() As String
    ReDim msgText5(1, 1 To 3, 1 To 2)
    Dim Antwort5
    
    Dim msgText6() As String
    ReDim msgText6(1, 1 To 3, 1 To 2)
    Dim Antwort6
    
    msgText1(1, 1, 1) = "Euribor 2Y could not be found. Please check the columnnames of the sourcefile": msgText1(1, 1, 2) = "Caution!"
    msgText1(1, 2, 1) = "Euribor 2Y konnte nicht gefunden werden. Bitte untersuchen Sie Spaltennamen der Quelldatei.": msgText1(1, 2, 2) = "Achtung"
    msgText1(1, 3, 1) = "Russisch": msgText1(1, 3, 2) = "Russisch!"
    
    msgText2(1, 1, 1) = "Euribor 1Y could not be found. Please check the columnnames of the sourcefile": msgText2(1, 1, 2) = "Caution!"
    msgText2(1, 2, 1) = "Euribor 1Y konnte nicht gefunden werden. Bitte untersuchen Sie Spaltennamen der Quelldatei.": msgText2(1, 2, 2) = "Achtung"
    msgText2(1, 3, 1) = "Russisch": msgText2(1, 3, 2) = "Russisch!"
    
    msgText3(1, 1, 1) = "Share B could not be found. Please check the columnnames of the sourcefile": msgText3(1, 1, 2) = "Caution!"
    msgText3(1, 2, 1) = "Share B konnte nicht gefunden werden. Bitte untersuchen Sie Spaltennamen der Quelldatei.": msgText3(1, 2, 2) = "Achtung"
    msgText3(1, 3, 1) = "Russisch": msgText3(1, 3, 2) = "Russisch!"
    
    msgText4(1, 1, 1) = "Share A could not be found. Please check the columnnames of the sourcefile": msgText4(1, 1, 2) = "Caution!"
    msgText4(1, 2, 1) = "Share A konnte nicht gefunden werden. Bitte untersuchen Sie Spaltennamen der Quelldatei.": msgText4(1, 2, 2) = "Achtung"
    msgText4(1, 3, 1) = "Russisch": msgText4(1, 3, 2) = "Russisch"
    
    msgText5(1, 1, 1) = "Wechselkurs could not be found. Please check the columnnames of the sourcefile": msgText5(1, 1, 2) = "Caution!"
    msgText5(1, 2, 1) = "Wechselkurs konnte nicht gefunden werden. Bitte untersuchen Sie Spaltennamen der Quelldatei.": msgText5(1, 2, 2) = "Achtung"
    msgText5(1, 3, 1) = "Russisch": msgText5(1, 3, 2) = "Russisch!"
    
    msgText6(1, 1, 1) = "Date could not be found. Please check the columnnames of the sourcefile": msgText6(1, 1, 2) = "Caution!"
    msgText6(1, 2, 1) = "Date konnte nicht gefunden werden. Bitte untersuchen Sie Spaltennamen der Quelldatei.": msgText6(1, 2, 2) = "Achtung"
    msgText6(1, 3, 1) = "Russisch": msgText6(1, 3, 2) = "Russisch!"
 
    Set Euribor2 = Range("A1:Z1").Find("Euribor 2Y")
    If Euribor2 Is Nothing Then
        Antwort1 = MsgBox(msgText1(1, Sprache, 1), vbRetryCancel, msgText1(1, Sprache, 2))
        If Antwort1 = vbCancel Then Exit Sub Else GoTo Start
    Exit Sub
    End If
    Range(Euribor2, Euribor2.End(xlDown)).Select
    Selection.Cut
    Columns("A:A").Select
    Selection.Insert Shift:=xlToRight
 
    Set Euribor1 = Range("A1:Z1").Find("Euribor 1Y")
    If Euribor1 Is Nothing Then
        Antwort2 = MsgBox(msgText2(1, Sprache, 1), vbRetryCancel, msgText2(2, Sprache, 2))
        If Antwort2 = vbCancel Then Exit Sub Else GoTo Start
    Exit Sub
    End If
     Range(Euribor1, Euribor1.End(xlDown)).Select
    Selection.Cut
    Columns("A:A").Select
    Selection.Insert Shift:=xlToRight
 
    Set ShareB = Range("A1:Z1").Find("Share B")
    If ShareB Is Nothing Then
     Antwort3 = MsgBox(msgText3(1, Sprache, 1), vbRetryCancel, msgText3(2, Sprache, 2))
        If Antwort3 = vbCancel Then Exit Sub Else GoTo Start
    Exit Sub
     End If
    Range(ShareB, ShareB.End(xlDown)).Select
    Selection.Cut
    Columns("A:A").Select
    Selection.Insert Shift:=xlToRight
 
    Set ShareA = Range("A1:Z1").Find("Share A")
    If ShareA Is Nothing Then
     Antwort4 = MsgBox(msgText4(1, Sprache, 1), vbRetryCancel, msgText4(2, Sprache, 2))
        If Antwort4 = vbCancel Then Exit Sub Else GoTo Start
    Exit Sub
     End If
    Range(ShareA, ShareA.End(xlDown)).Select
    Selection.Cut
    Columns("A:A").Select
    Selection.Insert Shift:=xlToRight
 
     Set Wechselkurs = Range("A1:Z1").Find("USD/EUR")
    If Wechselkurs Is Nothing Then
     Antwort5 = MsgBox(msgText5(1, Sprache, 1), vbRetryCancel, msgText5(2, Sprache, 2))
        If Antwort5 = vbCancel Then Exit Sub Else GoTo Start
    Exit Sub
     End If
    Range(Wechselkurs, Wechselkurs.End(xlDown)).Select
    Selection.Cut
    Columns("A:A").Select
    Selection.Insert Shift:=xlToRight
  
    Set DateX = Range("A1:Z1").Find("Date")
     If DateX Is Nothing Then
      Antwort6 = MsgBox(msgText6(1, Sprache, 1), vbRetryCancel, msgText6(2, Sprache, 2))
        If Antwort6 = vbCancel Then Exit Sub Else GoTo Start
    Exit Sub
     End If
     Range(DateX, DateX.End(xlDown)).Select
    Selection.Cut
    Columns("A:A").Select
  Selection.Insert Shift:=xlToRight

Für Hilfe wäre ich echt sehr dankbar :) 


Ihre Antwort
  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen
Thema: Name: Email:



  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen

Thema Datum  Von Nutzer Rating
Antwort
28.04.2017 01:19:42 Arni
NotSolved
28.04.2017 01:50:44 Gast42113
NotSolved
28.04.2017 01:52:23 Gast42113
NotSolved
28.04.2017 06:59:08 GraFri
NotSolved
29.04.2017 12:18:43 Arni
NotSolved
Blau Mehrsprachige MsgBox
29.04.2017 15:01:11 Arni
NotSolved
30.04.2017 08:33:12 GraFri
NotSolved
30.04.2017 18:39:59 Arni
NotSolved