|
▼hiro さん:
おはようございます。
標準モジュールに
'==================================================
Sub main()
Dim arng As Range
Dim brng As Range
With Worksheets("sheet1")
Set arng = .Range("a1", .Cells(.Rows.Count, "a").End(xlUp)).Resize(, 4)
End With
With Worksheets("sheet2")
Set brng = .Range("a1", .Cells(.Rows.Count, "a").End(xlUp)).Resize(, 3)
End With
With Worksheets("sheet3")
.Range(arng.Address).Value = arng.Value
.Range("e1").Value = "所属"
With .Range("e2", _
arng.SpecialCells(xlCellTypeLastCell).Offset(0, 1).Address)
.Formula = "=vlookup(a2," & brng.Address(, , , True) & ",3,false)"
End With
End With
End Sub
で試してください
|
|