|
シート名やセル範囲が決っていれば、リンクで値を引っ張ることが出来ます。
以下のようなコードで試してみて下さい。
Sub MyLink()
Dim C As Range
Dim AdAry As Variant
Dim i As Integer
Dim MyPh As String, MyFom As String
MyPh = ThisWorkbook.Path & "\"
AdAry = Array("$Q$1", "$W$5", "$X$1", "$E$12", "$R$15")
For Each C In Range("A1", Range("A65536").End(xlUp))
If Dir(MyPh & C.Value) <> "" Then
For i = 1 To 5
MyFom = "='" & MyPh & "[" & _
C.Value & "]様式3-3(1)'!" & AdAry(i - 1)
With C.Offset(, i)
.Formula = MyFom
.Value = .Value
End With
Next i
End If
Next
End Sub
|
|