Code funzt nicht!
04.09.2018 16:35:54
Ralpj
Ich bin ein absoluter Neuling in Vba. Ich hab mir folgenden code zusammengebastelt aber wenn das Makro am Schluss die (Application.Match) schleife macht, findet er keine passenden Werte.
Public wksZ As String
Sub openwb()
Dim sPath As String, sFile As String
Dim wb As Workbook
Dim a As String
Dim letzte As Long
Dim i As Long
sPath = "\\chca6027.eur.beluni.net\other$\AIR_CAIRE\Reports\HECR Migration\Activity _
planning\"
sFile = sPath & "DailyReconIRS_2018_V3_Test_Ali.xlsx"
Set wb = Workbooks.Open(sFile)
Application.DisplayAlerts = False
Workbooks("test.xlsm").Activate
Worksheets("Planning").Select
Range("A1:P500").Copy Destination:=Workbooks("DailyReconIRS_2018_V3_Test_Ali.xlsx").Sheets(" _
_
Rohdaten").Cells(1, 1)
Workbooks("DailyReconIRS_2018_V3_Test_Ali.xlsx").Activate
letzte = 440
For i = 6 To letzte
a = Application.Match(Worksheets("Rohdaten").Cells(i, 2), Worksheets("Planning").Columns( _
_
1), 0)
If ActiveCell(i, 1) = a Then
Name.Cells(i, 11) = Worksheets("Planning").Cells(a, 3)
MsgBox "schauen"
Else
MsgBox "nicht vorhanden"
End If
Next
End Sub