Thema Datum  Von Nutzer Rating
Antwort
25.01.2021 15:14:08 Emre
Solved
Blau VBA VLookup einfügen
25.01.2021 15:16:31 Gast9985
NotSolved
25.01.2021 15:44:18 Gast85027
Solved
25.01.2021 16:09:38 Gast86775
Solved

Ansicht des Beitrags:
Von:
Gast9985
Datum:
25.01.2021 15:16:31
Views:
827
Rating: Antwort:
  Ja
Thema:
VBA VLookup einfügen

leider bin ich neu hier und finde den Code-Button nicht :/

Hier ist nochmals Makro 1, was funktioniert

Sub TranslateCHN()

    Dim mainWs As Worksheet
    Dim dictionaryWs As Worksheet
    Dim mainLastRow As Long
    Dim dictionaryLastRow As Long
    Dim dictionaryRng As Range
    Dim x As Long
    
    
    Set mainWs = ThisWorkbook.Worksheets("Homologation Scheme")
    Set dictionaryWs = ThisWorkbook.Worksheets("Dictionary")
    
    mainLastRow = mainWs.Range("A" & Rows.Count).End(xlUp).Row
    dictionaryLastRow = dictionaryWs.Range("A" & Rows.Count).End(xlUp).Row
    
    Set dictionaryRng = dictionaryWs.Range("A2:B" & dictionaryLastRow)
    
    For x = 2 To mainLastRow
        On Error Resume Next
        mainWs.Range("A" & x).Value = Application.WorksheetFunction.VLookup( _
            mainWs.Range("A" & x).Value, dictionaryRng, 2, False)
        mainWs.Range("B" & x).Value = Application.WorksheetFunction.VLookup( _
            mainWs.Range("B" & x).Value, dictionaryRng, 2, False)
        mainWs.Range("C" & x).Value = Application.WorksheetFunction.VLookup( _
            mainWs.Range("C" & x).Value, dictionaryRng, 2, False)
        mainWs.Range("D" & x).Value = Application.WorksheetFunction.VLookup( _
            mainWs.Range("D" & x).Value, dictionaryRng, 2, False)
        mainWs.Range("E" & x).Value = Application.WorksheetFunction.VLookup( _
            mainWs.Range("E" & x).Value, dictionaryRng, 2, False)
        mainWs.Range("F" & x).Value = Application.WorksheetFunction.VLookup( _
            mainWs.Range("F" & x).Value, dictionaryRng, 2, False)
    Next x
    
End Sub
 

und Makro 2, was nicht funktioniert:

Sub TranslateEN()

    Dim mainWs As Worksheet
    Dim dictionaryWs As Worksheet
    Dim mainLastRow As Long
    Dim dictionaryLastRow As Long
    Dim dictionaryRng As Range
    Dim x As Long
    
    
    Set mainWs = ThisWorkbook.Worksheets("Homologation Scheme")
    Set dictionaryWs = ThisWorkbook.Worksheets("Dictionary")
    
    dictionaryLastRow = dictionaryWs.Range("B" & Rows.Count).End(xlUp).Row
    
    Set dictionaryRng = dictionaryWs.Range("A2:B" & dictionaryLastRow)
    
    For x = 2 To mainLastRow
        On Error Resume Next
        mainWs.Range("A" & x).Value = Application.WorksheetFunction.VLookup( _
            mainWs.Range("A" & x).Value, dictionaryRng, 1, False)
        mainWs.Range("B" & x).Value = Application.WorksheetFunction.VLookup( _
            mainWs.Range("B" & x).Value, dictionaryRng, 1, False)
        mainWs.Range("C" & x).Value = Application.WorksheetFunction.VLookup( _
            mainWs.Range("C" & x).Value, dictionaryRng, 1, False)
        mainWs.Range("D" & x).Value = Application.WorksheetFunction.VLookup( _
            mainWs.Range("D" & x).Value, dictionaryRng, 1, False)
        mainWs.Range("E" & x).Value = Application.WorksheetFunction.VLookup( _
            mainWs.Range("E" & x).Value, dictionaryRng, 1, False)
        mainWs.Range("F" & x).Value = Application.WorksheetFunction.VLookup( _
            mainWs.Range("F" & x).Value, dictionaryRng, 1, False)
    Next x
    
End Sub

 


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
25.01.2021 15:14:08 Emre
Solved
Blau VBA VLookup einfügen
25.01.2021 15:16:31 Gast9985
NotSolved
25.01.2021 15:44:18 Gast85027
Solved
25.01.2021 16:09:38 Gast86775
Solved