|
修正し再投稿
Sub test()
Dim dic As Object
Dim s As String
Dim ws As Worksheet
Dim r As Long
Dim v
Dim i As Long
Dim c As Range
Dim idx As Long
Set dic = CreateObject("Scripting.Dictionary")
For Each ws In Worksheets
If ws.Name Like "*単価" Then
v = ws.Range("A1").CurrentRegion.Value
For i = 2 To UBound(v)
dic(v(i, 2)) = Array(v(i, 3), v(i, 4), v(i, 5))
Next
s = Left(ws.Name, 6)
r = Worksheets(s).Range("C" & Rows.Count).End(xlUp).Row
For Each c In Worksheets(s).Range("C4:C" & r)
If dic.exists(c.Value) Then
c.Offset(, 1).Resize(, 3).Value = dic(c.Value)
End If
Next
End If
Next
End Sub
|
|