|
こんにちは
こんな感じかな?(シート名が不明ですが)
Dim Wb As Workbook
Set Wb = Workbooks("bbb.xls")
With Workbooks("aaa.xls").Worksheets("Sheet1")
If .Cells(1, 1).Value = Wb.Worksheets("Sheet1").Cells(1, 1).Value Then
.Cells(1, 2).Value = Wb.Worksheets("Sheet1").Cells(1, 2).Value
End If
End With
もし同じフォルダ内ならこれで良いかな?
Sub Test()
With ThisWorkbook.Worksheets("Sheet1")
With .Range("A1", .Range("A65536").End(xlUp)).Offset(, 1)
.Formula = "=IF(A1=[bbb.xls]Sheet1!A1,[bbb.xls]Sheet1!B1,"""")"
.Value = .Value
End With
End With
End Sub
|
|