sinned

Marko zum Namen suchen und Wert kopieren in zwei Workbooks

Hi,

I need help! Ich brauche ein Makro, welches in einem Sheet nach einem Namen sucht, den Wert kopiert und diesen in einem anderem Workbook an einer bestimmten stelle pasted.

Mein Ansatz:
Sub CommandButton1_Click()

Application.ScreenUpdating = False 'Screen off  

Dim i, f As Integer
Dim v As Double
Dim DerName As String

'Excel Datei öffnen  
    Workbooks.Open Filename:= _
        "C:\Users\XXX\Desktop\Einlesen.xlsx"  
        
For i = 7 To i = 181

  Workbooks("Einlesen.xlsx").Activate  
  
  DerName = Sheets("E_R_F_O_L_G_S_R_E_C_H_N_U_N_G").Cells(i, 2).Value  
  
  Workbooks("Controlling-Tool.xlsx").Activate  
  
    If DerName = Workbooks("Controlling-Tool.xlsx").Sheets("GuV").Cells(i, 2).Value Then  
  
     If Workbooks("Controlling-Tool.xlsx").Sheets("GuV").Cells(2, 2).Value = "April" Then  
      f = 7
       Else:
        If Workbooks("Controlling-Tool.xlsx").Sheets("GuV-").Cells(2, 2).Value = "May" Then  
         f = 8
          Else:
           f = 9
          
           End If
       End If
    End If

  Workbooks("Einlesen.xlsx").Activate  
  
  v = Sheets("E_R_F_O_L_G_S_R_E_C_H_N_U_N_G").Cells(i, 3).Value  
  
  Workbooks("Controlling-Tool.xlsx").Activate  
  
  Workbooks("Controlling-Tool.xlsx").Sheets("GuV").Cells(i + 3, f).Value = v  
  
  
'if Sheets("E_R_F_O_L_G_S_R_E_C_H_N_U_N_G").Cells(WorksheetFunction.Match(DerName, Workbooks("Controlling-Tool").Sheets("GuV").coloums(3), 0), 2) = _  
'WorksheetFunction.VLookup(DerName, Sheets("E_R_F_O_L_G_S_R_E_C_H_N_U_N_G").Range("A:C"), 3, 0)  

Next i
 
    
End Sub

Jemand eine Idee? Danke!
Auf Facebook teilen
Auf X (Twitter) teilen
Auf Reddit teilen
Auf Linkedin teilen

Content-ID: 239309

Url: https://administrator.de/forum/marko-zum-namen-suchen-und-wert-kopieren-in-zwei-workbooks-239309.html

Ausgedruckt am: 22.05.2025 um 04:05 Uhr

colinardo
Lösung colinardo 27.05.2014 aktualisiert um 18:50:34 Uhr
Goto Top
Moin sinned, Willkommen auf Administrator.de!
Das Thema hatten wir schon mehrmals, das sollte weiterhelfen:
oder dieses Demosheet

Range.Find() ist hier das Stichwort!

Grüße Uwe
sinned
sinned 27.05.2014 um 18:50:29 Uhr
Goto Top
Danke!