Suchwort ist nicht variabel
webdepp
ich habe da mal ein kleines Problem. Ich habe eine kleine Suche, dir mir dann die Werte aus dem einen WB in das andere schreiben soll. Nur bekommen ich das Suchwort nicht variabel. Es funktioniert nur, wenn ich v_suchwert einen festen Wert zuordne. Kann mir jmd helfen?
Fehlermeldung: Runtime Error 91, Object variable or With block variable not set
Danke
webdepp
Private Sub HW_Uebertragung_Click()
Dim v_hwscan As String
Dim v_wbscan As Workbook, v_wbplan As Workbook, v_wsscan As Worksheet, v_wsplan As _
Worksheet
Dim i As Long, v_lastrowscan As Long, v_lastrowplan As Long
Dim v_hwplan As String, Suche As String, v_suchwert As String
Dim v_fund As Integer
v_hwscan = Application.GetOpenFilename("Micrsoft Excel-Dateien (*.xls),*.xls")
Workbooks.Open v_hwscan
v_hwscan = ActiveWorkbook.Name 'Dateiname Scanergebnis
v_hwplan = ThisWorkbook.Name
Set v_wsscan = Workbooks(v_hwscan).Sheets("Sheet1")
Set v_wsplan = Workbooks(v_hwplan).Sheets("HW_SMI")
v_lastrowscan = v_wsscan.Cells(v_wsscan.Rows.Count, 2).End(xlUp).Row
v_lastrowplan = v_wsplan.Cells(v_wsplan.Rows.Count, 7).End(xlUp).Row
For i = 8 To 20 'v_wsplan.v_lastrowplan
'v_suchwert = v_wsplan.Cells(i, 7)
v_suchwert = "10.1.192.29"
v_fund = v_wsscan.Range("B:B").Find(v_suchwert, lookat:=xlWhole).Row
v_wsplan.Cells(i, 12) = v_wsscan.Cells(v_fund, 5) 'Lparname / Partionname
Next i
End Sub