auf Werte aus einer Arbeitsmappe Der Versuch, auf einen anderenTyp passt nicht zur Deklaration Arbeitsmappe VBA
Sub CopyValues()
'Current Workbook 1
Dim B As Worksheet: Set bun = Sheets("Workbook1Sheet1")
'Since Workbook 2 is open
'Getting a type mismatch error on this line, please note the workbook is open
Dim wkb2 As Workbook: Set wkb2 = "Workbook2.xls"
Dim x As Integer
x = 3
B.Range("E" & x).Value = "=vlookup(D3,'wkb2'A!$D:$F,3,0)"
End Sub
'Set wkb2 = Workbooks ("Workbook2")' – Ambie
Dank einer Tonne für die schnelle Antwort :) –
Auch denke ich, das '' bun' sollte sein B' in 'Dim B als Arbeitsblatt: Stellen Sie bun = Sheets ("Workbook1Sheet1") '. Ich würde empfehlen, dass Sie "Option Explicit" auf Ihrem Code hinzufügen –